template<class Value, class HashFn, class Compare>
struct te::detail::TypedValue< Value, HashFn, Compare >
This class is an implementation detail and is not part of the public interface of AnyValue.
TypedValue introduces the static type of the contained object into the inheritence heirarchy but does not, itself contain the object. AnyValueLink implements accessors to the contained object through overloads of a non-member function get_value(). TypedValue knows this statically, and knows that all TypedValue instances are really part of a larger AnyValueLink instance. Therefore, we implement AnyValue's virtual member functions at this point in the heirarchy so that we do not override any member functions of the contained objects, which might be inherited from in AnyValueLink.
- Template Parameters
-
Value | - The type of the contained value. |
|
const std::size_t | hash |
| The hash code obtained by invoking an instance of HashFn on the contained object. More...
|
|
template<class T , class H , class C > |
bool | is (const AnyValue< H, C > &any_v) |
| Check if any_v contains an object of type T. More...
|
|
template<class T , class H , class C , class ... Args> |
std::unique_ptr< AnyValue< H, C > > | make_any_value (std::size_t hash_value, Args &&... args) |
| Constructs a std::unique_ptr<AnyValue<H, C>> suitable for splicing into an AnySet instance. More...
|
|
template<class T , class H , class C , class ... Args> |
std::unique_ptr< AnyValue< H, C > > | make_any_value (H hasher, Args &&... args) |
| Constructs a std::unique_ptr<AnyValue<H, C>> suitable for splicing into an AnySet<H , C> instance. More...
|
|
template<class To , class H , class C > |
To | polymorphic_cast (const AnyValue< H, C > &any_v) |
| Access the contained object through a reference to dynamic type To . More...
|
|
template<class To , class H , class C > |
To | polymorphic_cast (const AnyValue< H, C > *any_v) |
| Access the contained object through a pointer to dynamic type To . More...
|
|
template<class To , class H , class C > |
To | exact_cast (const AnyValue< H, C > &any_v) |
| Access the contained object. More...
|
|
template<class To , class H , class C > |
To | exact_cast (const AnyValue< H, C > *any_v) |
| Access the contained object. More...
|
|
template<class To , class H , class C > |
To | unsafe_cast (const AnyValue< H, C > &any_v) |
| Access the contained object without dynamic type checking. More...
|
|
template<class T , class H , class C > |
const T * | try_as (const AnyValue< H, C > &any_v) |
| Get a pointer to the contained object of type T. If the contained object is not an instance of type T, returns nullptr. More...
|
|
template<class T , class H , class C > |
const T & | as (const AnyValue< H, C > &self) |
| Get a reference to the contained object of type T. If the contained object is not an instance of type T, throws a std::bad_cast. More...
|
|
template<class T , class H , class C > |
const T & | get (const AnyValue< H, C > &any_v) |
|
template<class T , class H , class C , class DefaultRef > |
const std::decay_t< T > & | get_default_ref (const AnyValue< H, C > &any_v, DefaultRef &&default_ref) |
| Get the contained value in any_v through a reference to const T . More...
|
|
template<class T , class H , class C , class DefaultVal > |
T | get_default_val (const AnyValue< H, C > &any_v, DefaultVal &&default_val) |
| Get a copy of the contained value in any_v of type T . More...
|
|