|
|
adobe::any_regular_t Class Reference
[Libraries]
#include <adobe/any_regular.hpp>
Detailed Description
- Model Of:
-
- Details:
- Type Promotion
adobe::any_regular_t leverages adobe::promote while storing instance values.
- Todo:
- The reliance of any_regular_t on type promotion is current problematic and really ammounts to a poor-mans approach to refinements. In this case the desired functionality is to be able to extract something which models a number regardless of the actual numeric type stored. This is still an open problem.
- Getting a Value
adobe::any_regular_t uses cast<>() to get its instance value. It behaves like an explicit cast getting a any_regular_t out will always succeed and simply returns the same any_regular_t.
- Setting a Value
adobe::any_regular_t uses assign<>() to set its instance value. It behaves like an explicit assignment. Assigning an any_regular_t into a any_regular_t simply assigns the values; it does not introduce another layer of indirection.
- How does adobe::any_regular_t differ from boost::any?
- any_regular_t differs from
boost::any in several ways:
- any_regular_t models EqualityComparable, fully modeling a Regular.
- any_regular_t supports type promotion. See
adobe::promote for more details. - cast<>() results are returned by reference, making any_regular_t generally more efficient.
- small values (less than or equal to 64-96 bits depending on architecture and alignment requirements) with a non-throwing default constructor are stored without a free store allocation.
- Note:
- With currently compilers the trait
boost::has_no_throw_construct must be manually declared for small types to be stored without a free store allocation.
- Tutorial:
- A tutorial for any_regular_t is available.
|
Classes |
| class | transform |
| | Function object used in binding for instance value access. More...
|
|