VCCC  2024.05
VisualCamp Common C++ library
min_max_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_MIN_MAX_RESULT_HPP
6 #define VCCC_ALGORITHM_RANGES_MIN_MAX_RESULT_HPP
7 
8 #include <type_traits>
9 #include <utility>
10 
13 
14 namespace vccc {
15 namespace ranges {
16 
19 
20 template<typename T>
24 
25  template<typename T2, std::enable_if_t<
27  constexpr operator min_max_result<T2>() const & {
28  return {min, max};
29  }
30 
31  template<typename T2, std::enable_if_t<
33  constexpr operator min_max_result<T2>() && {
34  return {std::move(min), std::move(max)};
35  }
36 };
37 
39 
40 } // namespace ranges
41 } // namespace vccc
42 
43 #endif // VCCC_ALGORITHM_RANGES_MIN_MAX_RESULT_HPP
Definition: directory.h:12
#define VCCC_NO_UNIQUE_ADDRESS
Definition: no_unique_address.hpp:9
Models std::convertible_to
Definition: convertible_to.hpp:38
Definition: min_max_result.hpp:21
VCCC_NO_UNIQUE_ADDRESS T max
Definition: min_max_result.hpp:23
VCCC_NO_UNIQUE_ADDRESS T min
Definition: min_max_result.hpp:22