diff --git a/src/MemoryX.h b/src/MemoryX.h index 796a25575..5130a4c7c 100644 --- a/src/MemoryX.h +++ b/src/MemoryX.h @@ -45,7 +45,8 @@ namespace std { { // Break compilation if Y* does not convert to X* // I should figure out the right use of enable_if instead - static_assert((static_cast((Y*){}), true)); + static_assert((static_cast((Y*){}), true), + "Pointer types not convertible"); } inline void operator() (void *p) const @@ -93,6 +94,10 @@ namespace std { #define nullptr std::__get_nullptr_t() + // "Cast" anything as an rvalue reference. + template inline typename remove_reference::type&& move(T&& t) + { return static_cast::type&&>(t); } + template> class unique_ptr : private D // use empty base optimization { @@ -290,10 +295,6 @@ namespace std { template inline T&& forward(typename remove_reference::type&& t) { return static_cast(t); } - // "Cast" anything as an rvalue reference. - template inline typename remove_reference::type&& move(T&& t) - { return static_cast::type&&>(t); } - // We need make_shared for ourselves, because the library doesn't use variadics template inline shared_ptr make_shared(Args&&... args) {