My Project
move_if_noexcept.hpp
Go to the documentation of this file.
1 
28 #ifndef BSL_MOVE_IF_NOEXCEPT_HPP
29 #define BSL_MOVE_IF_NOEXCEPT_HPP
30 
31 #include "conditional.hpp"
34 #include "move.hpp"
35 
36 namespace bsl
37 {
51  template<typename T>
52  constexpr conditional_t<
54  T const &,
55  T &&>
56  move_if_noexcept(T &val) noexcept
57  {
58  return move(val);
59  }
60 
61 }
62 
63 #endif
typename conditional< B, T, F >::type conditional_t
a helper that reduces the verbosity of bsl::conditional
Definition: conditional.hpp:54
constexpr bsl::remove_reference_t< T > && move(T &&val) noexcept
Used to indicate that an object "val" may be "moved from", i.e. allowing the efficient transfer of re...
Definition: move.hpp:57
static constexpr value_type value
the type T that stores the integral constant
Definition: integral_constant.hpp:54
constexpr conditional_t< !is_nothrow_move_constructible< T >::value &&is_copy_constructible< T >::value, T const &, T && > move_if_noexcept(T &val) noexcept
move_if_noexcept obtains an rvalue reference to its argument if its move constructor does not throw e...
Definition: move_if_noexcept.hpp:56