VCCC  2024.05
VisualCamp Common C++ library
sized_range.hpp
Go to the documentation of this file.
1 //
2 // Created by yonggyulee on 2023/12/24.
3 //
4 
5 #ifndef VCCC_RANGES_SIZED_RANGE_HPP_
6 #define VCCC_RANGES_SIZED_RANGE_HPP_
7 
8 #include <type_traits>
9 
10 #include "vccc/__ranges/range.hpp"
11 #include "vccc/__ranges/size.hpp"
14 
15 namespace vccc {
16 namespace ranges {
17 namespace detail {
18 
20 struct sized_range_impl : std::false_type {};
21 
22 template<typename T>
23 struct sized_range_impl<T, true> : is_invocable<decltype(ranges::size), T&> {};
24 
25 } // namespace detail
26 
29 
37 template<typename T>
38 struct sized_range : detail::sized_range_impl<T> {};
39 
41 
42 } // namespace ranges
43 } // namespace vccc
44 
45 #endif // VCCC_RANGES_SIZED_RANGE_HPP_
Definition: directory.h:12
constexpr VCCC_INLINE_OR_STATIC detail::element_niebloid< 1 > value
Definition: key_value.hpp:35
specifies that a range knows its size in constant time
Definition: sized_range.hpp:38