@@ -34,101 +34,7 @@ read_all_impl_decay_cold(input in, typename input::char_type *first, typename in
3434 }
3535}
3636
37- #if 0
38- template<typename char_type,::std::input_or_output_iterator output_iter>
39- inline output_iter type_punning_copy(char_type const* first,char_type const* last,output_iter result)
40- {
41- using value_type = ::std::iter_value_t<output_iter>;
42- if constexpr(sizeof(value_type)==0)
43- return result;
44- else if constexpr(sizeof(value_type)==sizeof(char_type))
45- {
46- for(;first!=last;)
47- {
48- if constexpr(::std::same_as<char_type,value_type>)
49- *result=*first;
50- else
51- {
52- my_memcpy(__builtin_addressof(result),first,sizeof(value_type));
53- }
54- ++first;
55- ++result;
56- }
57- return result;
58- }
59- else
60- {
61- static_assert(sizeof(char_type)==1);
62- for(;first!=last;)
63- {
64- my_memcpy(__builtin_addressof(result),first,sizeof(value_type));
65- first+=sizeof(value_type);
66- ++result;
67- }
68- return result;
69- }
70- }
7137
72- template<::fast_io::input_stream input,::std::forward_iterator Iter>
73- inline constexpr void read_all_impl_none_contiguous(input in,Iter first,Iter last)
74- {
75- using char_type = typename input::char_type;
76- using iter_value_type = ::std::iter_value_t<Iter>;
77- if constexpr(::fast_io::buffer_input_stream<input>)
78- {
79- auto to_read{::std::distance(first,last)};
80- for(;to_read;)
81- {
82- auto curr{ibuffer_curr(in)};
83- auto ed{ibuffer_end(in)};
84- auto remains{ed-curr};
85- if constexpr(sizeof(char_type)==sizeof(iter_value_type))
86- {
87- if(to_read<remains)
88- {
89- remains=to_read;
90- to_read=0;
91- }
92- else
93- {
94- to_read-=remains;
95- }
96- }
97- else
98- {
99- ::std::size_t real_to_read{static_cast<::std::size_t>(to_read)*sizeof(iter_value_type)};
100- if(real_to_read<remains)
101- {
102- remains=real_to_read;
103- to_read=0;
104- }
105- else
106- {
107- to_read-=remains/;
108- }
109- }
110-
111- first=type_punning_copy(curr,curr+remains,first);
112- ibuffer_set_curr(in,curr);
113- if(curr)
114- }
115- }
116- else
117- {
118- constexpr ::std::size_t buffer_size{512};
119- char_type buffer[buffer_size];
120- auto to_read{::std::distance(first,last)};
121- for(;to_read;)
122- {
123- ::std::size_t read_this_round{buffer_size};
124- if(to_read>=buffer_size)
125- {
126-
127- }
128- }
129- }
130- }
131- #endif
13238template <::fast_io::input_stream input>
13339inline constexpr void read_all_impl_decay (input in, typename input::char_type *first, typename input::char_type *last)
13440{
0 commit comments