19
19
20
20
namespace sparrow
21
21
{
22
- map_value::map_value (const array_wrapper* flat_keys, const array_wrapper* flat_items,
23
- size_type index_begin, size_type index_end, bool keys_sorted)
22
+ map_value::map_value (
23
+ const array_wrapper* flat_keys,
24
+ const array_wrapper* flat_items,
25
+ size_type index_begin,
26
+ size_type index_end,
27
+ bool keys_sorted
28
+ )
24
29
: p_flat_keys(flat_keys)
25
30
, p_flat_items(flat_items)
26
31
, m_index_begin(index_begin)
@@ -39,7 +44,7 @@ namespace sparrow
39
44
return m_index_end - m_index_begin;
40
45
}
41
46
42
- auto map_value::operator [](const key_type& key) const -> const_mapped_reference
47
+ auto map_value::operator [](const key_type& key) const -> const_mapped_reference
43
48
{
44
49
size_type index = find_index (key);
45
50
if (index == m_index_end)
@@ -76,7 +81,7 @@ namespace sparrow
76
81
77
82
auto map_value::find_index (const key_type& key) const noexcept -> size_type
78
83
{
79
- #if SPARROW_GCC_11_2_WORKAROUND
84
+ #if SPARROW_GCC_11_2_WORKAROUND
80
85
using T0 = sparrow::nullable<sparrow::null_type, bool >;
81
86
using T1 = sparrow::nullable<bool , bool >;
82
87
using T2 = sparrow::nullable<unsigned char , bool >;
@@ -90,23 +95,35 @@ namespace sparrow
90
95
using T11 = sparrow::nullable<numeric::float16_t , bool >;
91
96
using T12 = sparrow::nullable<float , bool >;
92
97
using T13 = sparrow::nullable<double , bool >;
93
- using T14 = sparrow::nullable<std::basic_string<char , std::char_traits<char >, std::allocator<char > >, bool >;
94
- using T15 = sparrow::nullable<std::vector<std::byte, std::allocator<std::byte> >, bool >;
95
- using T16 = sparrow::nullable<std::chrono::time_point<std::chrono::_V2::system_clock, std::chrono::duration<int , std::ratio<86400 , 1 > > >, bool >;
96
- using T17 = sparrow::nullable<std::chrono::time_point<std::chrono::_V2::system_clock, std::chrono::duration<long int , std::ratio<1 , 1000 > > >, bool >;
97
- using T18 = sparrow::nullable<date::zoned_time<std::chrono::duration<long int , std::ratio<1 , 1 > >, const date::time_zone*>, bool >;
98
- using T19 = sparrow::nullable<date::zoned_time<std::chrono::duration<long int , std::ratio<1 , 1000 > >, const date::time_zone*>, bool >;
99
- using T20 = sparrow::nullable<date::zoned_time<std::chrono::duration<long int , std::ratio<1 , 1000000 > >, const date::time_zone*>, bool >;
100
- using T21 = sparrow::nullable<date::zoned_time<std::chrono::duration<long int , std::ratio<1 , 1000000000 > >, const date::time_zone*>, bool >;
98
+ using T14 = sparrow::nullable<std::basic_string<char , std::char_traits<char >, std::allocator<char >>, bool >;
99
+ using T15 = sparrow::nullable<std::vector<std::byte, std::allocator<std::byte>>, bool >;
100
+ using T16 = sparrow::nullable<
101
+ std::chrono::time_point<std::chrono::_V2::system_clock, std::chrono::duration<int , std::ratio<86400 , 1 >>>,
102
+ bool >;
103
+ using T17 = sparrow::nullable<
104
+ std::chrono::time_point<std::chrono::_V2::system_clock, std::chrono::duration<long int , std::ratio<1 , 1000 >>>,
105
+ bool >;
106
+ using T18 = sparrow::nullable<
107
+ date::zoned_time<std::chrono::duration<long int , std::ratio<1 , 1 >>, const date::time_zone*>,
108
+ bool >;
109
+ using T19 = sparrow::nullable<
110
+ date::zoned_time<std::chrono::duration<long int , std::ratio<1 , 1000 >>, const date::time_zone*>,
111
+ bool >;
112
+ using T20 = sparrow::nullable<
113
+ date::zoned_time<std::chrono::duration<long int , std::ratio<1 , 1000000 >>, const date::time_zone*>,
114
+ bool >;
115
+ using T21 = sparrow::nullable<
116
+ date::zoned_time<std::chrono::duration<long int , std::ratio<1 , 1000000000 >>, const date::time_zone*>,
117
+ bool >;
101
118
using T22 = sparrow::nullable<sparrow::zoned_time_without_timezone_seconds, bool >;
102
119
using T23 = sparrow::nullable<sparrow::zoned_time_without_timezone_milliseconds, bool >;
103
120
using T24 = sparrow::nullable<sparrow::zoned_time_without_timezone_microseconds, bool >;
104
121
using T25 = sparrow::nullable<sparrow::zoned_time_without_timezone_nanoseconds, bool >;
105
- using T26 = sparrow::nullable<std::chrono::duration<long int , std::ratio<1 , 1 > >, bool >;
106
- using T27 = sparrow::nullable<std::chrono::duration<long int , std::ratio<1 , 1000 > >, bool >;
107
- using T28 = sparrow::nullable<std::chrono::duration<long int , std::ratio<1 , 1000000 > >, bool >;
108
- using T29 = sparrow::nullable<std::chrono::duration<long int , std::ratio<1 , 1000000000 > >, bool >;
109
- using T30 = sparrow::nullable<std::chrono::duration<int , std::ratio<2629746 , 1 > >, bool >;
122
+ using T26 = sparrow::nullable<std::chrono::duration<long int , std::ratio<1 , 1 >>, bool >;
123
+ using T27 = sparrow::nullable<std::chrono::duration<long int , std::ratio<1 , 1000 >>, bool >;
124
+ using T28 = sparrow::nullable<std::chrono::duration<long int , std::ratio<1 , 1000000 >>, bool >;
125
+ using T29 = sparrow::nullable<std::chrono::duration<long int , std::ratio<1 , 1000000000 >>, bool >;
126
+ using T30 = sparrow::nullable<std::chrono::duration<int , std::ratio<2629746 , 1 >>, bool >;
110
127
using T31 = sparrow::nullable<sparrow::days_time_interval, bool >;
111
128
using T32 = sparrow::nullable<sparrow::month_day_nanoseconds_interval, bool >;
112
129
using T33 = sparrow::nullable<sparrow::chrono::time_seconds, bool >;
@@ -166,24 +183,32 @@ namespace sparrow
166
183
T43 t43;
167
184
return size_type (0 );
168
185
#else
169
- return std::visit ([this ](const auto & k) {
170
- return visit ([&k, this ](const auto & ar) {
171
- for (size_type i = m_index_begin; i != m_index_end; ++i)
172
- {
173
- const auto & val = ar[i];
174
- using T = std::decay_t <decltype (k)>;
175
- using U = std::decay_t <decltype (val)>;
176
- if constexpr (std::same_as<T, U>)
186
+ return std::visit (
187
+ [this ](const auto & k)
188
+ {
189
+ return visit (
190
+ [&k, this ](const auto & ar)
177
191
{
178
- if (val == k )
192
+ for (size_type i = m_index_begin; i != m_index_end; ++i )
179
193
{
180
- return i;
194
+ const auto & val = ar[i];
195
+ using T = std::decay_t <decltype (k)>;
196
+ using U = std::decay_t <decltype (val)>;
197
+ if constexpr (std::same_as<T, U>)
198
+ {
199
+ if (val == k)
200
+ {
201
+ return i;
202
+ }
203
+ }
181
204
}
182
- }
183
- }
184
- return m_index_end;
185
- }, *p_flat_keys);
186
- }, key);
205
+ return m_index_end;
206
+ },
207
+ *p_flat_keys
208
+ );
209
+ },
210
+ key
211
+ );
187
212
#endif
188
213
}
189
214
0 commit comments