...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::fallback_to_default
// In header: <boost/log/attributes/fallback_policy_fwd.hpp> template<typename DefaultT> struct fallback_to_default { // construct/copy/destruct fallback_to_default(); explicit fallback_to_default(default_type const &); // public member functions template<typename FunT> bool apply_default(FunT &) const; template<typename FunT> bool apply_default(FunT const &) const; // public static functions static void on_invalid_type(typeindex::type_index const &); static void on_missing_value(); };
The fallback_to_default
policy results in a default value if the attribute value cannot be extracted.