VCCC  2024.05
VisualCamp Common C++ library
basic_istream.hpp
Go to the documentation of this file.
1 //
2 // Created by yonggyulee on 2/3/24.
3 //
4 
5 #ifndef VCCC_RANGES_VIEWS_BASIC_ISTREAM_HPP
6 #define VCCC_RANGES_VIEWS_BASIC_ISTREAM_HPP
7 
8 #include <type_traits>
9 
14 
15 namespace vccc {
16 namespace ranges {
17 namespace views {
18 namespace detail {
19 
20 template<typename T, typename = void>
21 struct has_typename_char_type : std::false_type {};
22 template<typename T>
23 struct has_typename_char_type<T, void_t<typename T::char_type>> : std::true_type {};
24 
25 template<typename T, typename = void>
26 struct has_typename_traits_type : std::false_type {};
27 template<typename T>
28 struct has_typename_traits_type<T, void_t<typename T::traits_type>> : std::true_type {};
29 
30 template<typename U, bool = conjunction<has_typename_char_type<U>, has_typename_traits_type<U>>::value /* false */>
31 struct derived_from_basic_istream : std::false_type {};
32 template<typename U>
34  : derived_from<U, std::basic_istream<typename U::char_type, typename U::traits_type>> {};
35 
36 template<typename T>
38  template<typename E, std::enable_if_t<
40  >::value, int> = 0>
41  constexpr auto operator()(E&& e) const {
42  using U = std::remove_reference_t<decltype(e)>;
44  }
45 };
46 
47 } // namespace detail
48 
51 
52 template<typename T>
54 
56 
57 } // namespace views
58 } // namespace ranges
59 } // namespace vccc
60 
61 #endif // VCCC_RANGES_VIEWS_BASIC_ISTREAM_HPP
Definition: basic_istream_view.hpp:39
constexpr T e
the mathematical constant
Definition: constants.hpp:37
constexpr VCCC_INLINE_OR_STATIC detail::basic_istream_niebloid< T > istream
Definition: basic_istream.hpp:53
void void_t
Definition: void_t.hpp:19
#define VCCC_INLINE_OR_STATIC
Definition: inline_or_static.hpp:9
Definition: directory.h:12
constexpr VCCC_INLINE_OR_STATIC detail::element_niebloid< 1 > value
Definition: key_value.hpp:35
Models std::derived_from
Definition: derived_from.hpp:42
constexpr auto operator()(E &&e) const
Definition: basic_istream.hpp:41