...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_none
// In header: <boost/log/attributes/fallback_policy.hpp> struct fallback_to_none { enum { guaranteed_result = false }; // public static functions template<typename FunT> static bool apply_default(FunT &); template<typename FunT> static bool apply_default(FunT const &); static void on_invalid_type(typeindex::type_index const &); static void on_missing_value(); };
The fallback_to_none
policy results in returning an empty value reference if the attribute value cannot be extracted.
fallback_to_none
public static functionstemplate<typename FunT> static bool apply_default(FunT &);
The method is called in order to apply a function object to the default value.
template<typename FunT> static bool apply_default(FunT const &);
The method is called in order to apply a function object to the default value.
static void on_invalid_type(typeindex::type_index const &);
The method is called when value extraction failed because the attribute value has different type than requested.
static void on_missing_value();
The method is called when value extraction failed because the attribute value was not found.