...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::attributes::constant — A class of an attribute that holds a single constant value.
// In header: <boost/log/attributes/constant.hpp> template<typename T> class constant : public attribute { public: // types typedef T value_type; // Attribute value type. // member classes/structs/unions // Factory implementation. class impl : public attribute_value_impl< value_type > { public: // public member functions explicit impl(value_type const &); explicit impl(value_type &&) noexcept(boost::is_nothrow_move_constructible< value_type >::value); }; // public member functions explicit constant(value_type const &); explicit constant(value_type &&); explicit constant(cast_source const &); value_type const & get() const; };
The constant is a simplest and one of the most frequently used types of attributes. It stores a constant value, which it eventually returns as its value each time requested.
constant
public member functionsexplicit constant(value_type const & value);
Constructor with the stored value initialization
explicit constant(value_type && value);
Constructor with the stored value initialization
explicit constant(cast_source const & source);
Constructor for casting support
value_type const & get() const;
Returns: |
Reference to the contained value. |