August 2017
Intermediate to advanced
438 pages
14h 19m
English
Detecting disabled RTTI, storing information about types, and comparing types at runtime are tricks that are widely used across Boost libraries.
#include <boost/config.hpp>
#if !defined(BOOST_NO_RTTI) \ && !defined(BOOST_NO_CXX11_HDR_TYPEINDEX)#include <typeindex>using std::type_index;template <class T>type_index type_id() { return typeid(T);}
#else#include <cstring>#include <iosfwd> // std::basic_ostream#include <boost/current_function.hpp>struct type_index { const char * name_; explicit type_index(const ...Read now
Unlock full access