- Model Of:
-
- Details:
- Type Promotion
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. The feature becomes especially important if serialization happens between the writer and reader. This is still an open problem.
- Getting a Value
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
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:
- Note
- With currently compilers the trait
boost::has_no_throw_copy
must be manually declared for small types to be stored without a free store allocation.
- See Also:
- adobe::runtime_cast
- Tutorial:
- A tutorial for any_regular_t is available.
Definition at line 426 of file any_regular.hpp.