boostorg / core

Boost Core Utilities
132 stars 87 forks source link

Also disable addressof for r-values when possible #30

Closed glenfe closed 7 years ago

glenfe commented 7 years ago

Now in C++17: template<class T> const T* addressof(const T&&) = delete;

Lastique commented 7 years ago

Doesn't this disable addressof for all non-const types? Shouldn't there be disable_if_c< is_reference< T >::value >::type?

pdimov commented 7 years ago

T can never be a reference here.

Lastique commented 7 years ago

Ah, I forgot there is already an overload for lvalue reference. Sorry for the noise.