VCCC  2024.05
VisualCamp Common C++ library
value_swappable.hpp
Go to the documentation of this file.
1 //
2 // Created by yonggyulee on 1/25/24.
3 //
4 
5 #ifndef VCCC_CONCEPTS_VALUE_SWAPPABLE_HPP
6 #define VCCC_CONCEPTS_VALUE_SWAPPABLE_HPP
7 
8 #include <type_traits>
9 
13 
14 namespace vccc {
15 namespace detail {
16 
17 template<typename I1, typename I2, bool = conjunction<dereferenceable<I1>, dereferenceable<I2>>::value>
18 struct ValueSwappableImpl : std::false_type {};
19 template<typename I1, typename I2>
20 struct ValueSwappableImpl<I1, I2, true>
21  : is_swappable<decltype(*std::declval<I1&>(), *std::declval<I2&>())> {};
22 
23 } // namespace detail
24 
27 
28 template<typename I1, typename I2>
29 struct ValueSwappable : detail::ValueSwappableImpl<I1, I2> {};
30 
32 
33 } // namespace vccc
34 
35 #endif // VCCC_CONCEPTS_VALUE_SWAPPABLE_HPP
Definition: directory.h:12
Definition: value_swappable.hpp:29