Boost C++ Libraries of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards


Struct template extract_or_throw

boost::log::result_of::extract_or_throw — A metafunction that allows to acquire the result of the value extraction.


// In header: <boost/log/attributes/value_extraction.hpp>

template<typename T, typename TagT> 
struct extract_or_throw {
  // types
  typedef mpl::if_< mpl::is_sequence< T >, value_ref< T, TagT >, Tconst & >::type type;


The metafunction results in a type that is in form of T const&, if T is not an MPL type sequence, or value_ref< T, TagT > otherwise. In the latter case the value reference shall never be empty.