container.hpp
Go to the documentation of this file.
1 // Copyright (C) 2020-2024 Jonathan Müller and lexy contributors
2 // SPDX-License-Identifier: BSL-1.0
3 
4 #ifndef LEXY_CALLBACK_CONTAINER_HPP_INCLUDED
5 #define LEXY_CALLBACK_CONTAINER_HPP_INCLUDED
6 
7 #include <lexy/callback/base.hpp>
8 
9 namespace lexy
10 {
11 struct nullopt;
12 
13 template <typename Container>
14 using _detect_reserve = decltype(LEXY_DECLVAL(Container&).reserve(std::size_t()));
15 template <typename Container>
16 constexpr auto _has_reserve = _detail::is_detected<_detect_reserve, Container>;
17 
18 template <typename Container>
19 using _detect_append = decltype(LEXY_DECLVAL(Container&).append(LEXY_DECLVAL(Container&&)));
20 template <typename Container>
21 constexpr auto _has_append = _detail::is_detected<_detect_append, Container>;
22 } // namespace lexy
23 
24 //=== as_list ===//
25 namespace lexy
26 {
27 template <typename Container>
28 struct _list_sink
29 {
30  Container _result;
31 
32  using return_type = Container;
33 
34  template <typename C = Container, typename U>
35  constexpr auto operator()(U&& obj) -> decltype(LEXY_DECLVAL(C&).push_back(LEXY_FWD(obj)))
36  {
37  return _result.push_back(LEXY_FWD(obj));
38  }
39 
40  template <typename C = Container, typename... Args>
41  constexpr auto operator()(Args&&... args)
42  -> decltype(LEXY_DECLVAL(C&).emplace_back(LEXY_FWD(args)...))
43  {
44  return _result.emplace_back(LEXY_FWD(args)...);
45  }
46 
47  constexpr Container&& finish() &&
48  {
49  return LEXY_MOV(_result);
50  }
51 };
52 
53 template <typename Container, typename AllocFn>
55 {
56  AllocFn _alloc;
57 
58  using return_type = Container;
59 
60  template <typename State>
61  struct _with_state
62  {
63  State& _state;
64  const AllocFn& _alloc;
65 
66  constexpr Container operator()(Container&& container) const
67  {
68  return LEXY_MOV(container);
69  }
70  constexpr Container operator()(nullopt&&) const
71  {
72  return Container(_detail::invoke(_alloc, _state));
73  }
74 
75  template <typename... Args>
76  constexpr auto operator()(Args&&... args) const
77  -> LEXY_DECAY_DECLTYPE((LEXY_DECLVAL(Container&).push_back(LEXY_FWD(args)), ...),
78  LEXY_DECLVAL(Container))
79  {
80  Container result(_detail::invoke(_alloc, _state));
81  if constexpr (_has_reserve<Container>)
82  result.reserve(sizeof...(args));
83  (result.emplace_back(LEXY_FWD(args)), ...);
84  return result;
85  }
86  };
87 
88  template <typename State>
89  constexpr auto operator[](State& state) const
90  {
91  return _with_state<State>{state, _alloc};
92  }
93 
94  template <typename State>
95  constexpr auto sink(State& state) const
96  {
97  return _list_sink<Container>{Container(_detail::invoke(_alloc, state))};
98  }
99 };
100 
101 template <typename Container>
102 struct _list
103 {
104  using return_type = Container;
105 
106  constexpr Container operator()(Container&& container) const
107  {
108  return LEXY_MOV(container);
109  }
110  constexpr Container operator()(nullopt&&) const
111  {
112  return Container();
113  }
114 
115  template <typename... Args>
116  constexpr auto operator()(Args&&... args) const
117  -> LEXY_DECAY_DECLTYPE((LEXY_DECLVAL(Container&).push_back(LEXY_FWD(args)), ...),
118  LEXY_DECLVAL(Container))
119  {
120  Container result;
121  if constexpr (_has_reserve<Container>)
122  result.reserve(sizeof...(args));
123  (result.emplace_back(LEXY_FWD(args)), ...);
124  return result;
125  }
126  template <typename C = Container, typename... Args>
127  constexpr auto operator()(const typename C::allocator_type& allocator, Args&&... args) const
128  -> decltype((LEXY_DECLVAL(C&).push_back(LEXY_FWD(args)), ...), C(allocator))
129  {
130  Container result(allocator);
131  if constexpr (_has_reserve<Container>)
132  result.reserve(sizeof...(args));
133  (result.emplace_back(LEXY_FWD(args)), ...);
134  return result;
135  }
136 
137  constexpr auto sink() const
138  {
139  return _list_sink<Container>{Container()};
140  }
141  template <typename C = Container>
142  constexpr auto sink(const typename C::allocator_type& allocator) const
143  {
144  return _list_sink<Container>{Container(allocator)};
145  }
146 
147  template <typename AllocFn>
148  constexpr auto allocator(AllocFn alloc_fn) const
149  {
150  return _list_alloc<Container, AllocFn>{alloc_fn};
151  }
152  constexpr auto allocator() const
153  {
154  return allocator([](const auto& alloc) { return alloc; });
155  }
156 };
157 
160 template <typename Container>
161 constexpr auto as_list = _list<Container>{};
162 } // namespace lexy
163 
164 //=== as_collection ===//
165 namespace lexy
166 {
167 template <typename Container>
169 {
170  Container _result;
171 
172  using return_type = Container;
173 
174  template <typename C = Container, typename U>
175  constexpr auto operator()(U&& obj) -> decltype(LEXY_DECLVAL(C&).insert(LEXY_FWD(obj)))
176  {
177  return _result.insert(LEXY_FWD(obj));
178  }
179 
180  template <typename C = Container, typename... Args>
181  constexpr auto operator()(Args&&... args)
182  -> decltype(LEXY_DECLVAL(C&).emplace(LEXY_FWD(args)...))
183  {
184  return _result.emplace(LEXY_FWD(args)...);
185  }
186 
187  constexpr Container&& finish() &&
188  {
189  return LEXY_MOV(_result);
190  }
191 };
192 
193 template <typename Container, typename AllocFn>
195 {
196  AllocFn _alloc;
197 
198  using return_type = Container;
199 
200  template <typename State>
201  struct _with_state
202  {
203  State& _state;
204  const AllocFn& _alloc;
205 
206  constexpr Container operator()(Container&& container) const
207  {
208  return LEXY_MOV(container);
209  }
210  constexpr Container operator()(nullopt&&) const
211  {
212  return Container(_detail::invoke(_alloc, _state));
213  }
214 
215  template <typename... Args>
216  constexpr auto operator()(Args&&... args) const
217  -> LEXY_DECAY_DECLTYPE((LEXY_DECLVAL(Container&).insert(LEXY_FWD(args)), ...),
218  LEXY_DECLVAL(Container))
219  {
220  Container result(_detail::invoke(_alloc, _state));
221  if constexpr (_has_reserve<Container>)
222  result.reserve(sizeof...(args));
223  (result.emplace(LEXY_FWD(args)), ...);
224  return result;
225  }
226  };
227 
228  template <typename State>
229  constexpr auto operator[](State& state) const
230  {
231  return _with_state<State>{state, _alloc};
232  }
233 
234  template <typename State>
235  constexpr auto sink(State& state) const
236  {
237  return _collection_sink<Container>{Container(_detail::invoke(_alloc, state))};
238  }
239 };
240 
241 template <typename Container>
243 {
244  using return_type = Container;
245 
246  constexpr Container operator()(Container&& container) const
247  {
248  return LEXY_MOV(container);
249  }
250  constexpr Container operator()(nullopt&&) const
251  {
252  return Container();
253  }
254 
255  template <typename... Args>
256  constexpr auto operator()(Args&&... args) const
257  -> LEXY_DECAY_DECLTYPE((LEXY_DECLVAL(Container&).insert(LEXY_FWD(args)), ...),
258  LEXY_DECLVAL(Container))
259  {
260  Container result;
261  if constexpr (_has_reserve<Container>)
262  result.reserve(sizeof...(args));
263  (result.emplace(LEXY_FWD(args)), ...);
264  return result;
265  }
266 
267  template <typename C = Container, typename... Args>
268  constexpr auto operator()(const typename C::allocator_type& allocator, Args&&... args) const
269  -> decltype((LEXY_DECLVAL(C&).insert(LEXY_FWD(args)), ...), C(allocator))
270  {
271  Container result(allocator);
272  if constexpr (_has_reserve<Container>)
273  result.reserve(sizeof...(args));
274  (result.emplace(LEXY_FWD(args)), ...);
275  return result;
276  }
277 
278  constexpr auto sink() const
279  {
280  return _collection_sink<Container>{Container()};
281  }
282  template <typename C = Container>
283  constexpr auto sink(const typename C::allocator_type& allocator) const
284  {
285  return _collection_sink<Container>{Container(allocator)};
286  }
287 
288  template <typename AllocFn>
289  constexpr auto allocator(AllocFn alloc_fn) const
290  {
291  return _collection_alloc<Container, AllocFn>{alloc_fn};
292  }
293  constexpr auto allocator() const
294  {
295  return allocator([](const auto& alloc) { return alloc; });
296  }
297 };
298 
301 template <typename T>
302 constexpr auto as_collection = _collection<T>{};
303 } // namespace lexy
304 
305 //=== concat ===//
306 namespace lexy
307 {
308 template <typename Container>
309 struct _concat
310 {
311  using return_type = Container;
312 
313  constexpr Container operator()(nullopt&&) const
314  {
315  return Container();
316  }
317 
318  template <typename... Tail>
319  constexpr Container _call(Container&& head, Tail&&... tail) const
320  {
321  if constexpr (sizeof...(Tail) == 0)
322  return LEXY_MOV(head);
323  else
324  {
325  if constexpr (_has_reserve<Container>)
326  {
327  auto total_size = (head.size() + ... + tail.size());
328  head.reserve(total_size);
329  }
330 
331  auto append = [&head](Container&& container) {
332  if constexpr (_has_append<Container>)
333  {
334  head.append(LEXY_MOV(container));
335  }
336  else
337  {
338  for (auto& elem : container)
339  head.push_back(LEXY_MOV(elem));
340  }
341  };
342  (append(LEXY_MOV(tail)), ...);
343 
344  return LEXY_MOV(head);
345  }
346  }
347 
348  template <typename... Args>
349  constexpr auto operator()(Args&&... args) const -> decltype(_call(Container(LEXY_FWD(args))...))
350  {
351  return _call(Container(LEXY_FWD(args))...);
352  }
353 
354  struct _sink
355  {
356  Container _result;
357 
358  using return_type = Container;
359 
360  constexpr void operator()(Container&& container)
361  {
362  if (_result.empty())
363  {
364  // We assign until we have items.
365  // That way we get the existing allocator.
366  _result = LEXY_MOV(container);
367  }
368  else if constexpr (_has_append<Container>)
369  {
370  _result.append(LEXY_MOV(container));
371  }
372  else
373  {
374  if constexpr (_has_reserve<Container>)
375  {
376  auto capacity = _result.capacity();
377  auto total_size = _result.size() + container.size();
378  if (total_size > capacity)
379  {
380  // If we need more space we reserve at least twice as much.
381  auto exp_capacity = 2 * capacity;
382  if (total_size > exp_capacity)
383  _result.reserve(total_size);
384  else
385  _result.reserve(exp_capacity);
386  }
387  }
388 
389  for (auto& elem : container)
390  _result.push_back(LEXY_MOV(elem));
391  }
392  }
393 
394  constexpr Container&& finish() &&
395  {
396  return LEXY_MOV(_result);
397  }
398  };
399 
400  constexpr auto sink() const
401  {
402  return _sink{};
403  }
404 };
405 
406 template <typename Container>
407 constexpr auto concat = _concat<Container>{};
408 } // namespace lexy
409 
410 //=== collect ===//
411 namespace lexy
412 {
413 template <typename Container, typename Callback>
415 {
416 public:
417  constexpr explicit _collect_sink(Callback callback) : _callback(LEXY_MOV(callback)) {}
418  template <typename C = Container>
419  constexpr explicit _collect_sink(Callback callback, const typename C::allocator_type& allocator)
420  : _result(allocator), _callback(LEXY_MOV(callback))
421  {}
422 
423  using return_type = Container;
424 
425  template <typename... Args>
426  constexpr auto operator()(Args&&... args)
427  -> decltype(void(LEXY_DECLVAL(Callback)(LEXY_FWD(args)...)))
428  {
429  _result.push_back(_callback(LEXY_FWD(args)...));
430  }
431 
432  constexpr auto finish() &&
433  {
434  return LEXY_MOV(_result);
435  }
436 
437 private:
438  Container _result;
440 };
441 template <typename Callback>
442 class _collect_sink<void, Callback>
443 {
444 public:
445  constexpr explicit _collect_sink(Callback callback) : _count(0), _callback(LEXY_MOV(callback))
446  {}
447 
448  using return_type = std::size_t;
449 
450  template <typename... Args>
451  constexpr auto operator()(Args&&... args)
452  -> decltype(void(LEXY_DECLVAL(Callback)(LEXY_FWD(args)...)))
453  {
454  _callback(LEXY_FWD(args)...);
455  ++_count;
456  }
457 
458  constexpr auto finish() &&
459  {
460  return _count;
461  }
462 
463 private:
464  std::size_t _count;
466 };
467 
468 template <typename Container, typename Callback>
469 class _collect
470 {
471 public:
472  constexpr explicit _collect(Callback callback) : _callback(LEXY_MOV(callback)) {}
473 
474  constexpr auto sink() const
475  {
477  }
478  template <typename C = Container>
479  constexpr auto sink(const typename C::allocator_type& allocator) const
480  {
482  }
483 
484 private:
486 };
487 
490 template <typename Callback>
491 constexpr auto collect(Callback&& callback)
492 {
493  using callback_t = std::decay_t<Callback>;
494  static_assert(std::is_void_v<typename callback_t::return_type>,
495  "need to specify a container to collect into for non-void callbacks");
497 }
498 
500 template <typename Container, typename Callback>
501 constexpr auto collect(Callback&& callback)
502 {
503  using callback_t = std::decay_t<Callback>;
504  static_assert(!std::is_void_v<typename callback_t::return_type>,
505  "cannot collect a void callback into a container");
507 }
508 } // namespace lexy
509 
510 #endif // LEXY_CALLBACK_CONTAINER_HPP_INCLUDED
511 
LEXY_MOV
#define LEXY_MOV(...)
Definition: config.hpp:29
lexy::_collect_sink< void, Callback >::_collect_sink
constexpr _collect_sink(Callback callback)
Definition: container.hpp:445
lexy::_collection::operator()
constexpr auto operator()(Args &&... args) const -> LEXY_DECAY_DECLTYPE((LEXY_DECLVAL(Container &).insert(LEXY_FWD(args)),...), LEXY_DECLVAL(Container))
Definition: container.hpp:256
lexy::_collection_alloc::_with_state::_alloc
const AllocFn & _alloc
Definition: container.hpp:204
lexy::_list_sink::_result
Container _result
Definition: container.hpp:30
base.hpp
lexy::_collection_sink::operator()
constexpr auto operator()(U &&obj) -> decltype(LEXY_DECLVAL(C &).insert(LEXY_FWD(obj)))
Definition: container.hpp:175
lexy::collect
constexpr auto collect(Callback &&callback)
Definition: container.hpp:491
lexy::_list::operator()
constexpr auto operator()(Args &&... args) const -> LEXY_DECAY_DECLTYPE((LEXY_DECLVAL(Container &).push_back(LEXY_FWD(args)),...), LEXY_DECLVAL(Container))
Definition: container.hpp:116
lexy::_collection_alloc::_with_state::_state
State & _state
Definition: container.hpp:203
lexy::_collection_alloc::_alloc
AllocFn _alloc
Definition: container.hpp:196
lexy::_list::sink
constexpr auto sink(const typename C::allocator_type &allocator) const
Definition: container.hpp:142
lexy::_collection
Definition: container.hpp:242
lexy::_list_alloc::_with_state::_alloc
const AllocFn & _alloc
Definition: container.hpp:64
lexy::_collect_sink::_collect_sink
constexpr _collect_sink(Callback callback, const typename C::allocator_type &allocator)
Definition: container.hpp:419
lexy::_collection::allocator
constexpr auto allocator() const
Definition: container.hpp:293
lexy::_has_append
constexpr auto _has_append
Definition: container.hpp:21
lexy::_list::operator()
constexpr Container operator()(Container &&container) const
Definition: container.hpp:106
lexy::_list::return_type
Container return_type
Definition: container.hpp:104
lexy::_collection::return_type
Container return_type
Definition: container.hpp:244
lexy::nullopt
Definition: option.hpp:25
lexy::_list::allocator
constexpr auto allocator() const
Definition: container.hpp:152
LEXY_FWD
#define LEXY_FWD(...)
Definition: config.hpp:30
lexy::_collection_alloc::_with_state::operator()
constexpr Container operator()(Container &&container) const
Definition: container.hpp:206
lexy::_list_alloc::_with_state::_state
State & _state
Definition: container.hpp:63
lexy::as_collection
constexpr auto as_collection
Definition: container.hpp:302
lexy::_collect_sink< void, Callback >::operator()
constexpr auto operator()(Args &&... args) -> decltype(void(LEXY_DECLVAL(Callback)(LEXY_FWD(args)...)))
Definition: container.hpp:451
lexy::_concat::operator()
constexpr Container operator()(nullopt &&) const
Definition: container.hpp:313
lexy::_collect_sink
Definition: container.hpp:414
lexy::_list::operator()
constexpr auto operator()(const typename C::allocator_type &allocator, Args &&... args) const -> decltype((LEXY_DECLVAL(C &).push_back(LEXY_FWD(args)),...), C(allocator))
Definition: container.hpp:127
lexy
Definition: any_ref.hpp:12
lexy::_concat::_sink
Definition: container.hpp:354
detail::void
j template void())
Definition: json.hpp:4893
lexy::_list::sink
constexpr auto sink() const
Definition: container.hpp:137
lexy::_concat::return_type
Container return_type
Definition: container.hpp:311
lexy::_callback
Definition: adapter.hpp:12
lexy::_concat::_sink::_result
Container _result
Definition: container.hpp:356
lexy::callback
constexpr auto callback(Fns &&... fns)
Creates a callback.
Definition: adapter.hpp:48
lexy::_list_sink::finish
constexpr Container && finish() &&
Definition: container.hpp:47
lexy::_concat::sink
constexpr auto sink() const
Definition: container.hpp:400
lexyd::nullopt
constexpr auto nullopt
Definition: option.hpp:50
lexy::_list
Definition: container.hpp:102
lexy::_concat
Definition: container.hpp:309
lexy::_collection_alloc::operator[]
constexpr auto operator[](State &state) const
Definition: container.hpp:229
lexy::_list_alloc::_with_state::operator()
constexpr Container operator()(nullopt &&) const
Definition: container.hpp:70
lexy::_concat::operator()
constexpr auto operator()(Args &&... args) const -> decltype(_call(Container(LEXY_FWD(args))...))
Definition: container.hpp:349
lexy::_collection_sink::operator()
constexpr auto operator()(Args &&... args) -> decltype(LEXY_DECLVAL(C &).emplace(LEXY_FWD(args)...))
Definition: container.hpp:181
lexy::_collect::_callback
LEXY_EMPTY_MEMBER Callback _callback
Definition: container.hpp:485
lexy::_collection::allocator
constexpr auto allocator(AllocFn alloc_fn) const
Definition: container.hpp:289
lexy::_collect_sink::_collect_sink
constexpr _collect_sink(Callback callback)
Definition: container.hpp:417
lexy::_collect::sink
constexpr auto sink(const typename C::allocator_type &allocator) const
Definition: container.hpp:479
lexy::_collect_sink< void, Callback >::return_type
std::size_t return_type
Definition: container.hpp:448
lexy::_collection_alloc::_with_state
Definition: container.hpp:201
lexy::_list_alloc::sink
constexpr auto sink(State &state) const
Definition: container.hpp:95
lexy::_list_alloc::_with_state
Definition: container.hpp:61
lexy::_collect_sink::return_type
Container return_type
Definition: container.hpp:423
LEXY_DECAY_DECLTYPE
#define LEXY_DECAY_DECLTYPE(...)
Definition: config.hpp:34
lexy::_collect_sink< void, Callback >::_callback
LEXY_EMPTY_MEMBER Callback _callback
Definition: container.hpp:465
lexy::_collection::sink
constexpr auto sink() const
Definition: container.hpp:278
lexy::_detail::invoke
constexpr auto invoke(F ClassT::*f, Args &&... args) -> decltype(_mem_invoker< F ClassT::* >::invoke(f, LEXY_FWD(args)...))
Definition: invoke.hpp:56
lexy::_collection::operator()
constexpr Container operator()(Container &&container) const
Definition: container.hpp:246
lexy::_list_sink::operator()
constexpr auto operator()(U &&obj) -> decltype(LEXY_DECLVAL(C &).push_back(LEXY_FWD(obj)))
Definition: container.hpp:35
lexy::_collect_sink< void, Callback >::_count
std::size_t _count
Definition: container.hpp:464
lexy::_concat::_sink::operator()
constexpr void operator()(Container &&container)
Definition: container.hpp:360
lexy::_list::operator()
constexpr Container operator()(nullopt &&) const
Definition: container.hpp:110
lexy::_collection_sink::finish
constexpr Container && finish() &&
Definition: container.hpp:187
lexy::_concat::_sink::return_type
Container return_type
Definition: container.hpp:358
lexy::_collection_sink::return_type
Container return_type
Definition: container.hpp:172
lexy::concat
constexpr auto concat
Definition: container.hpp:407
lexy::_detect_reserve
decltype(LEXY_DECLVAL(Container &).reserve(std::size_t())) _detect_reserve
Definition: container.hpp:14
lexy::_has_reserve
constexpr auto _has_reserve
Definition: container.hpp:16
lexy::as_list
constexpr auto as_list
Definition: container.hpp:161
lexy::_collection_alloc::_with_state::operator()
constexpr Container operator()(nullopt &&) const
Definition: container.hpp:210
lexy::_collect
Definition: container.hpp:469
lexy::_collect_sink::operator()
constexpr auto operator()(Args &&... args) -> decltype(void(LEXY_DECLVAL(Callback)(LEXY_FWD(args)...)))
Definition: container.hpp:426
lexy::_list_alloc::operator[]
constexpr auto operator[](State &state) const
Definition: container.hpp:89
lexy::_collection_alloc::sink
constexpr auto sink(State &state) const
Definition: container.hpp:235
lexy::_detect_append
decltype(LEXY_DECLVAL(Container &).append(LEXY_DECLVAL(Container &&))) _detect_append
Definition: container.hpp:19
lexy::_concat::_sink::finish
constexpr Container && finish() &&
Definition: container.hpp:394
lexy::_concat::_call
constexpr Container _call(Container &&head, Tail &&... tail) const
Definition: container.hpp:319
lexy::_collect_sink< void, Callback >::finish
constexpr auto finish() &&
Definition: container.hpp:458
lexy::_collect::_collect
constexpr _collect(Callback callback)
Definition: container.hpp:472
lexy::_collection_alloc
Definition: container.hpp:194
lexy::_collect::sink
constexpr auto sink() const
Definition: container.hpp:474
lexy::_list::allocator
constexpr auto allocator(AllocFn alloc_fn) const
Definition: container.hpp:148
lexy::_list_alloc::return_type
Container return_type
Definition: container.hpp:58
lexy::_collection::sink
constexpr auto sink(const typename C::allocator_type &allocator) const
Definition: container.hpp:283
lexy::_collect_sink::_result
Container _result
Definition: container.hpp:438
lexy::_list_sink
Definition: container.hpp:28
lexy::_collection::operator()
constexpr Container operator()(nullopt &&) const
Definition: container.hpp:250
lexy::_list_sink::operator()
constexpr auto operator()(Args &&... args) -> decltype(LEXY_DECLVAL(C &).emplace_back(LEXY_FWD(args)...))
Definition: container.hpp:41
lexy::_collection_sink::_result
Container _result
Definition: container.hpp:170
lexy::_list_alloc::_with_state::operator()
constexpr auto operator()(Args &&... args) const -> LEXY_DECAY_DECLTYPE((LEXY_DECLVAL(Container &).push_back(LEXY_FWD(args)),...), LEXY_DECLVAL(Container))
Definition: container.hpp:76
lexy::_collection_alloc::_with_state::operator()
constexpr auto operator()(Args &&... args) const -> LEXY_DECAY_DECLTYPE((LEXY_DECLVAL(Container &).insert(LEXY_FWD(args)),...), LEXY_DECLVAL(Container))
Definition: container.hpp:216
lexy::_list_alloc::_alloc
AllocFn _alloc
Definition: container.hpp:56
LEXY_EMPTY_MEMBER
#define LEXY_EMPTY_MEMBER
Definition: config.hpp:193
lexy::_collection_sink
Definition: container.hpp:168
lexy::_collect_sink::_callback
LEXY_EMPTY_MEMBER Callback _callback
Definition: container.hpp:439
LEXY_DECLVAL
#define LEXY_DECLVAL(...)
Definition: config.hpp:32
lexy::_list_alloc::_with_state::operator()
constexpr Container operator()(Container &&container) const
Definition: container.hpp:66
lexy::_list_alloc
Definition: container.hpp:54
lexy::_collection::operator()
constexpr auto operator()(const typename C::allocator_type &allocator, Args &&... args) const -> decltype((LEXY_DECLVAL(C &).insert(LEXY_FWD(args)),...), C(allocator))
Definition: container.hpp:268
lexy::_collection_alloc::return_type
Container return_type
Definition: container.hpp:198
lexy::_collect_sink::finish
constexpr auto finish() &&
Definition: container.hpp:432
lexy::_list_sink::return_type
Container return_type
Definition: container.hpp:32


behaviortree_cpp_v4
Author(s): Davide Faconti
autogenerated on Fri Dec 13 2024 03:19:16