...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
boost::log::type_dispatcher — A type dispatcher interface.
// In header: <boost/log/utility/type_dispatch/type_dispatcher.hpp> class type_dispatcher { public: // member classes/structs/unions template<typename T> class callback { public: // public member functions void operator()(T const &) const; explicit operator bool() const noexcept; bool operator!() const noexcept; }; // construct/copy/destruct explicit type_dispatcher(get_callback_impl_type) noexcept; // protected member functions BOOST_DEFAULTED_FUNCTION(type_dispatcher(type_dispatcher const &that), :m_get_callback_impl(that.m_get_callback_impl) {}); };
All type dispatchers support this interface. It is used to acquire the visitor interface for the requested type.
type_dispatcher
protected member functionsBOOST_DEFAULTED_FUNCTION(type_dispatcher(type_dispatcher const &that), :m_get_callback_impl(that.m_get_callback_impl) {});
The method requests a callback for the value of type T
Returns: |
The type-specific callback or an empty value, if the type is not supported |