August 2017
Intermediate to advanced
438 pages
14h 19m
English
The macro BOOST_NO_RTTI is be defined if RTTI is disabled, and the macro BOOST_NO_CXX11_HDR_TYPEINDEX is be defined when the compiler has no <typeindex> header and no std::type_index class.
The handwritten type_index structure from step 3 of the previous section only holds the pointer to some string; nothing really interesting here.
Take a look at the BOOST_CURRENT_FUNCTION macro. It returns the full name of the current function, including template parameters, arguments, and the return type. For example, type_id<double>() is represented as follows:
type_index type_id() [with T = double]
So, for any other type, BOOST_CURRENT_FUNCTION returns a different string, and that's why the type_index variable from the example does not ...
Read now
Unlock full access