VCCC  2024.05
VisualCamp Common C++ library
output_iterator.hpp
Go to the documentation of this file.
1 //
2 // Created by cosge on 2023-12-31.
3 //
4 
5 #ifndef VCCC_ITERATOR_OUTPUT_ITERATOR_HPP
6 #define VCCC_ITERATOR_OUTPUT_ITERATOR_HPP
7 
8 #include <type_traits>
9 
13 
14 namespace vccc {
15 namespace detail {
16 
17 template<
18  typename I,
19  typename T,
20  bool = conjunction<
21  input_or_output_iterator<I>,
22  indirectly_writable<I, T>
23  >::value
24 >
25 struct output_iterator_impl
26  : std::is_assignable<
27  decltype(*std::declval<I&>()++),
28  decltype(std::forward<T>(std::declval<T&&>()))
29  > {};
30 
31 template<typename I, typename T>
32 struct output_iterator_impl<I, T, false> : std::false_type {};
33 
34 } // namespace detail
35 
38 
57 template<typename I, typename T>
58 struct output_iterator : detail::output_iterator_impl<I, T> {};
59 
61 
62 } // namespace vccc
63 
64 #endif // VCCC_ITERATOR_OUTPUT_ITERATOR_HPP
Definition: directory.h:12
constexpr VCCC_INLINE_OR_STATIC detail::element_niebloid< 1 > value
Definition: key_value.hpp:35
specifies that a type is an output iterator for a given value type, that is, values of that type can ...
Definition: output_iterator.hpp:58