Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::type_erasure::relaxed Struct Reference

This special concept enables various useful default behavior that makes any act like an ordinary object. More...

#include <relaxed.hpp>

Inheritance diagram for boost::type_erasure::relaxed:
Collaboration diagram for boost::type_erasure::relaxed:

Detailed Description

This special concept enables various useful default behavior that makes any act like an ordinary object.

By default any forwards all operations to the underlying type, and provides only the operations that are specified in its Concept.

In detail, relaxed enables the following:

  • A raw value can be assigned to an any. This will replace the value stored by the any. (But note that if assignable is present, it takes priority.)
  • copy assignment of any uses the copy constructor if it can't use assignable (either because assignable is missing, or because the stored types do not match).
  • default construction of any is allowed and creates a null any.
  • equality_comparable: If the types do not match, it will return false.
  • less_than_comparable: If the types do not match, the ordering will be according to std::type_info::before.
  • if the arguments to any other function do not match, it will throw a bad_function_call exception instead of having undefined behavior.

The documentation for this struct was generated from the following file: