libbio
Loading...
Searching...
No Matches
Classes | Static Public Attributes | List of all members
bio::pointer_detail::IsPointerConvertible< FROM, TO > Struct Template Reference

#include <Pointer.h>

Static Public Attributes

static const bool sValue = (sizeof(Test(MakeFrom())) == sizeof(Yes))
 

Detailed Description

template<typename FROM, typename TO>
struct bio::pointer_detail::IsPointerConvertible< FROM, TO >

IsPointerConvertible< FROM, TO >::sValue is true iff a FROM* is IMPLICITLY convertible to a TO* — i.e. exactly when the bare pointers would convert (Derived* -> Base*, T* -> const T*, T* -> void*).

Implemented with the classic two-overload sizeof SFINAE idiom so it behaves identically under C++98 and C++20 (std::is_convertible does not exist on cpp98, and type::IsBaseOf is hard-wired to false on cpp98, so neither is usable as the gate for the converting constructor).

The Test(FROM*) overload is viable only when the implicit FROM* -> TO* conversion exists; otherwise the ellipsis overload wins.

Template Parameters
FROMthe source pointee type.
TOthe destination pointee type.

Member Data Documentation

◆ sValue

template<typename FROM , typename TO >
const bool bio::pointer_detail::IsPointerConvertible< FROM, TO >::sValue = (sizeof(Test(MakeFrom())) == sizeof(Yes))
static

The documentation for this struct was generated from the following file: