My Project
add_lvalue_reference.hpp
Go to the documentation of this file.
1 
28 #ifndef BSL_ADD_LVALUE_REFERENCE_HPP
29 #define BSL_ADD_LVALUE_REFERENCE_HPP
30 
31 #include "cstdint.hpp"
32 #include "type_identity.hpp"
33 
34 namespace bsl
35 {
36  namespace details
37  {
46  template<typename T>
47  auto try_add_lvalue_reference(bsl::int32 ignored) noexcept -> type_identity<T &>;
48 
57  template<typename T>
58  auto try_add_lvalue_reference(bool ignored) noexcept -> type_identity<T>;
59  }
60 
71  template<typename T>
72  struct add_lvalue_reference final
73  {
75  using type = typename decltype(details::try_add_lvalue_reference<T>(0))::type;
76  };
77 
79  template<typename T>
81 }
82 
83 #endif
auto try_add_lvalue_reference(bsl::int32 ignored) noexcept -> type_identity< T & >
Returns T with an added & if possible.
typename add_lvalue_reference< T >::type add_lvalue_reference_t
a helper that reduces the verbosity of bsl::add_lvalue_reference
Definition: add_lvalue_reference.hpp:80
typename decltype(details::try_add_lvalue_reference< T >(0))::type type
provides the member typedef "type"
Definition: add_lvalue_reference.hpp:75
::int32_t int32
defines an 32bit signed integer
Definition: cstdint.hpp:40
Provides the member typedef type which is the same as T, except that a topmost lvalue reference is ad...
Definition: add_lvalue_reference.hpp:72