MCPcopy Create free account
hub / github.com/Achain-Dev/Achain / cast_ptr

Function cast_ptr

include/win/boost/optional/optional.hpp:753–753  ·  view source on GitHub ↗

If T is of reference type, trying to get a pointer to the held value must result in a compile-time error. Decent compilers should disallow conversions from reference_content * to T*, but just in case, the following olverloads are used to filter out the case and guarantee an error in case of T being a reference.

Source from the content-addressed store, hash-verified

751 // Decent compilers should disallow conversions from reference_content<T>* to T*, but just in case,
752 // the following olverloads are used to filter out the case and guarantee an error in case of T being a reference.
753 pointer_const_type cast_ptr( internal_type const* p, is_not_reference_tag ) const { return p ; }
754 pointer_type cast_ptr( internal_type * p, is_not_reference_tag ) { return p ; }
755 pointer_const_type cast_ptr( internal_type const* p, is_reference_tag ) const { return &p->get() ; }
756 pointer_type cast_ptr( internal_type * p, is_reference_tag ) { return &p->get() ; }

Callers 1

get_ptr_implFunction · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected