Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Construct, New, Delete, Casts

You'll probably want to work with objects. There are lazy versions of constructor calls, new, delete and the suite of C++ casts. Examples:

construct<std::string>(arg1, arg2)  // constructs a std::string from arg1, arg2
new_<std::string>(arg1, arg2)       // makes a new std::string from arg1, arg2
delete_(arg1)                       // deletes arg1 (assumed to be a pointer)
static_cast_<int*>(arg1)            // static_cast's arg1 to an int*
[Note] Note

Take note that, by convention, names that conflict with C++ reserved words are appended with a single trailing underscore '_'

Learn more about this here.


PrevUpHomeNext