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.
| 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() ; } |