My Project
addressof.hpp
Go to the documentation of this file.
1 
28 #ifndef BSL_ADDRESSOF_HPP
29 #define BSL_ADDRESSOF_HPP
30 
31 namespace bsl
32 {
45  template<typename T>
46  [[nodiscard]] constexpr T *
47  addressof(T &val) noexcept
48  {
49  return __builtin_addressof(val);
50  }
51 
63  template<typename T>
64  T const *addressof(T const &&val) = delete;
65 }
66 
67 #endif
constexpr T * addressof(T &val) noexcept
Obtains the actual address of the object or function arg, even in presence of overloaded operator& (i...
Definition: addressof.hpp:47