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


behaviortree_cpp_v4
Author(s): Davide Faconti
autogenerated on Fri Jun 28 2024 02:20:07