## Function template extract_or_default

boost::log::extract_or_default

## Synopsis

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

    template<typename DescriptorT, template< typename > class ActorT,
             typename DefaultT>
      result_of::extract_or_default< typename DescriptorT::value_type, DefaultT, DescriptorT >::type
      extract_or_default(expressions::attribute_keyword< DescriptorT, ActorT > const & keyword,
                         attribute_value_set const & attrs,
                         DefaultT const & def_val);

## Description

The function extracts an attribute value from the view. The user has to explicitly specify the type or set of possible types of the attribute value to be extracted.

| Note
Caution must be exercised if the default value is a temporary object. Because the function returns a reference, if the temporary object is destroyed, the reference may become dangling.

Parameters:

`attrs` | A set of attribute values in which to look for the specified attribute value.
`def_val` | The default value
`keyword` | The keyword of the attribute value to extract.

Returns: | The extracted value, if found. The default value otherwise.