My Project
add_pointer.hpp
Go to the documentation of this file.
1 
28 #ifndef BSL_ADD_POINTER_HPP
29 #define BSL_ADD_POINTER_HPP
30 
31 #include "cstdint.hpp"
32 #include "remove_reference.hpp"
33 #include "type_identity.hpp"
34 
35 namespace bsl
36 {
37  namespace details
38  {
47  template<typename T>
48  auto try_add_pointer(bsl::int32 ignored) noexcept -> type_identity<remove_reference_t<T> *>;
49 
58  template<typename T>
59  auto try_add_pointer(bool ignored) noexcept -> type_identity<T>;
60  }
61 
72  template<typename T>
73  struct add_pointer final
74  {
76  using type = typename decltype(details::try_add_pointer<T>(0))::type;
77  };
78 
80  template<typename T>
82 }
83 
84 #endif
Provides the member typedef type which is the same as T, except that a topmost pointer is added.
Definition: add_pointer.hpp:73
auto try_add_pointer(bsl::int32 ignored) noexcept -> type_identity< remove_reference_t< T > * >
Returns T with an added * if possible.
typename add_pointer< T >::type add_pointer_t
a helper that reduces the verbosity of bsl::add_pointer
Definition: add_pointer.hpp:81
typename decltype(details::try_add_pointer< T >(0))::type type
provides the member typedef "type"
Definition: add_pointer.hpp:76
::int32_t int32
defines an 32bit signed integer
Definition: cstdint.hpp:40