37#if BIO_CPP_VERSION >= 11
38 #include <type_traits>
45namespace pointer_detail {
62template <
typename FROM,
typename TO >
66 struct Yes {
char mPad[1]; };
67 struct No {
char mPad[2]; };
71 static FROM* MakeFrom();
73 static const bool sValue = (
sizeof(Test(MakeFrom())) ==
sizeof(Yes));
113template <
typename T >
150 mHandle(::
bio::pointer_arena::HandleFor(
raw))
169 template <
typename U >
202 #if BIO_COMPACT_POINTER_STORAGE
218 template <
typename U >
225 #if BIO_COMPACT_POINTER_STORAGE
274 #if BIO_COMPACT_POINTER_STORAGE
275 return static_cast< T*
>(
const_cast< void*
>(::bio::pointer_arena::ResolveFast(mHandle)));
283 #if BIO_COMPACT_POINTER_STORAGE
296 #if BIO_CPP_VERSION >= 11
310 explicit operator bool()
const
326 template <
typename U >
341 template <
typename U >
378 #if BIO_COMPACT_POINTER_STORAGE
393template <
typename T >
399template <
typename T >
411template <
typename T >
426#if BIO_CPP_VERSION >= 11
434 #if BIO_COMPACT_POINTER_STORAGE
436 sizeof(Pointer< int >) ==
sizeof(uint32_t),
437 "compact Pointer< T > must be exactly one 32-bit handle wide.");
439 sizeof(Pointer< double >) ==
sizeof(uint32_t),
440 "compact Pointer< T > must be exactly one 32-bit handle wide.");
443 sizeof(Pointer< int >) ==
sizeof(
int*),
444 "Pointer< T > must be exactly one pointer wide (raw-pointer drop-in).");
446 sizeof(Pointer< double >) ==
sizeof(
void*),
447 "Pointer< T > must be exactly one pointer wide (raw-pointer drop-in).");
450 ::std::is_standard_layout< Pointer< int > >
::value,
451 "Pointer< T > must be standard-layout (raw-pointer drop-in).");
453 ::std::is_trivially_copyable< Pointer< int > >
::value,
454 "Pointer< T > must be trivially-copyable / trivially-relocatable.");
472template <
typename T >
473struct IsMemcpySafeImplementation< Pointer< T > >
475 static const bool sValue =
true;
498template <
typename T >
499struct IsPointerImplementation< Pointer< T > >
501 static const bool sValue =
true;
514template <
typename T >
515struct RemovePointer< Pointer< T > >
520template <
typename T >
521struct IsPointerWrapper< Pointer< T > >
523 static const bool sValue =
true;
#define BIO_COMPACT_POINTER_STORAGE
Definition OptimizeMacros.h:87
double value
Definition Potential.cpp:41
T & operator*() const
Definition Pointer.h:259
bool operator!=(const Pointer< U > &other) const
Definition Pointer.h:342
T * operator->() const
Definition Pointer.h:248
Pointer(T *raw)
Definition Pointer.h:146
Pointer()
Definition Pointer.h:122
bool operator==(const Pointer &other) const
Definition Pointer.h:321
T Type
Definition Pointer.h:117
T * Get() const
Definition Pointer.h:271
bool operator<(const Pointer &other) const
Definition Pointer.h:371
bool operator!=(const Pointer &other) const
Definition Pointer.h:336
bool operator!=(T *raw) const
Definition Pointer.h:360
bool operator==(const Pointer< U > &other) const
Definition Pointer.h:327
Pointer(const Pointer< U > &other, typename type::EnableIf< pointer_detail::IsPointerConvertible< U, T >::sValue, int >::Type=0)
Definition Pointer.h:170
type::EnableIf< pointer_detail::IsPointerConvertible< U, T >::sValue, Pointer & >::Type operator=(const Pointer< U > &other)
Definition Pointer.h:222
Pointer & operator=(T *raw)
Definition Pointer.h:199
bool operator==(T *raw) const
Definition Pointer.h:351
Handle HandleFor(const void *raw)
Definition PointerArena.cpp:2278
Definition FinalCell.h:29
void Delete(Pointer< T > wrapped)
Definition Pointer.h:412
bool operator!=(T *raw, const Pointer< T > &wrapped)
Definition Pointer.h:400
bool operator==(T *raw, const Pointer< T > &wrapped)
Definition Pointer.h:394
static const bool sValue
Definition Pointer.h:73
static const bool sValue
Definition IsMemcpySafe.h:61
static const bool sValue
Definition IsPointer.h:38
static const bool sValue
Definition IsPointer.h:80
RemovePointerImplementation< T >::Type Type
Definition RemovePointer.h:54