VCCC  2024.05
VisualCamp Common C++ library
in_value_result.hpp
Go to the documentation of this file.
1 //
2 // Created by yonggyulee on 1/25/24.
3 //
4 
5 #ifndef VCCC_ALGORITHM_RANGES_IN_VALUE_RESULT_HPP
6 #define VCCC_ALGORITHM_RANGES_IN_VALUE_RESULT_HPP
7 
8 #include <type_traits>
9 #include <utility>
10 
14 
15 namespace vccc {
16 namespace ranges {
17 
20 
21 template<typename I, typename T>
25 
26  template<typename I2, typename T2, std::enable_if_t<conjunction<
29  >::value, int> = 0>
30  constexpr operator in_value_result<I2, T2>() const & {
31  return {in, value};
32  }
33 
34  template<typename I2, typename T2, std::enable_if_t<conjunction<
37  >::value, int> = 0>
38  constexpr operator in_value_result<I2, T2>() && {
39  return {std::move(in), std::move(value)};
40  }
41 };
42 
44 
45 } // namespace ranges
46 } // namespace vccc
47 
48 #endif // VCCC_ALGORITHM_RANGES_IN_VALUE_RESULT_HPP
Definition: directory.h:12
#define VCCC_NO_UNIQUE_ADDRESS
Definition: no_unique_address.hpp:9
Definition: conjunction.hpp:22
Models std::convertible_to
Definition: convertible_to.hpp:38
Definition: in_value_result.hpp:22
VCCC_NO_UNIQUE_ADDRESS T value
Definition: in_value_result.hpp:24
VCCC_NO_UNIQUE_ADDRESS I in
Definition: in_value_result.hpp:23