proxsuite 0.6.7
The Advanced Proximal Optimization Toolbox
Loading...
Searching...
No Matches
tuple.hpp
Go to the documentation of this file.
1#ifndef VEG_TUPLE_HPP_B8PHUNWES
2#define VEG_TUPLE_HPP_B8PHUNWES
3
10
11#if defined(__GLIBCXX__)
12namespace std /* NOLINT */ {
13_GLIBCXX_BEGIN_NAMESPACE_VERSION
14template<typename T>
15struct tuple_size;
16template<::proxsuite::linalg::veg::usize, typename T>
17struct tuple_element;
18_GLIBCXX_END_NAMESPACE_VERSION
19} // namespace std
20#else
21#include <utility> // std::tuple_{size,element}
22#endif
23
24/******************************************************************************/
25#define __VEG_IMPL_BIND(I, Tuple, Identifier) /* NOLINT */ \
26 auto&& Identifier /* NOLINT */ = \
27 ::proxsuite::linalg::veg::nb::get<I>{}(VEG_FWD(Tuple));
28
29#define __VEG_IMPL_BIND_ID_SEQ(/* NOLINT */ \
30 CV_Auto, \
31 Identifiers, \
32 Tuple, \
33 Tuple_Size, \
34 TupleId) \
35 CV_Auto TupleId = Tuple; \
36 static_assert( \
37 ::std::tuple_size<typename ::proxsuite::linalg::veg::meta::uncvref_t< \
38 decltype(TupleId)>>::value == (Tuple_Size), \
39 "wrong number of identifiers"); \
40 __VEG_PP_TUPLE_FOR_EACH_I(__VEG_IMPL_BIND, TupleId, Identifiers) \
41 VEG_NOM_SEMICOLON
42
43// example: difference vs c++17 structure bindings
44// auto get() -> tuple<A, B&, C&&>;
45//
46// auto [a, b, c] = get();
47// VEG_BIND(auto, (x, y, z), get());
48// decltype({a,b,c}) => {A,B&,C&&} same as tuple_element<i, E>
49// decltype({x,y,z}) => {A&&,B&,C&&} always a reference, lvalue if initializer
50// expression or tuple_element<i, E> is an
51// lvalue, rvalue otherwise.
52//
53#define VEG_BIND(CV_Auto, Identifiers, Tuple) \
54 __VEG_IMPL_BIND_ID_SEQ(CV_Auto, \
55 Identifiers, \
56 Tuple, \
57 __VEG_PP_TUPLE_SIZE(Identifiers), \
58 __VEG_PP_CAT(_dummy_tuple_variable_id_, __LINE__))
59/******************************************************************************/
60
61namespace proxsuite {
62namespace linalg {
63namespace veg {
64template<typename T, usize I>
65using inner_ith = decltype(VEG_DECLVAL(T)[Fix<isize{ I }>{}]);
66
67template<typename... Ts>
68struct Tuple;
69
70namespace tuple {
71namespace nb {
72struct tuplify
73{
74 template<typename... Ts>
75 VEG_NODISCARD VEG_INLINE constexpr auto operator()(Ts... args) const
76 VEG_NOEXCEPT->proxsuite::linalg::veg::Tuple<Ts...>
77 {
78 return { tuplify{}, Ts(VEG_FWD(args))... };
79 }
80};
81} // namespace nb
82VEG_NIEBLOID(tuplify);
83} // namespace tuple
84
85inline namespace tags {
87using tuple::tuplify;
88} // namespace tags
89
90namespace tuple {
92} // namespace tuple
93
94namespace tuple {
95template<typename ISeq, typename... Ts>
97{};
98
99#if VEG_HAS_NO_UNIQUE_ADDRESS
100#define __VEG_IMPL_LEAF(Tuple, I, ...) /* NOLINT */ \
101 (static_cast< \
102 ::proxsuite::linalg::veg::tuple::TupleLeaf<I, __VA_ARGS__> const&>( \
103 (Tuple).inner) \
104 .leaf)
105#define __VEG_IMPL_LEAF_MUT(Tuple, I, ...) /* NOLINT */ \
106 (static_cast<::proxsuite::linalg::veg::tuple::TupleLeaf<I, __VA_ARGS__>&>( \
107 (Tuple).inner) \
108 .leaf)
109#define __VEG_IMPL_LEAF_ONCE(Tuple, I, ...) /* NOLINT */ \
110 (static_cast<__VA_ARGS__&&>( \
111 static_cast<::proxsuite::linalg::veg::tuple::TupleLeaf<I, __VA_ARGS__>&&>( \
112 (Tuple).inner) \
113 .leaf))
114
115template<usize I, typename T>
116struct TupleLeaf
117{
119};
120#else
121
122#define __VEG_IMPL_LEAF(Tuple, I, ...) /* NOLINT */ \
123 (static_cast<__VA_ARGS__ const&>( \
124 static_cast< \
125 ::proxsuite::linalg::veg::tuple::TupleLeaf<I, __VA_ARGS__> const&>( \
126 (Tuple).inner) \
127 .leaf_get()))
128
129#define __VEG_IMPL_LEAF_MUT(Tuple, I, ...) /* NOLINT */ \
130 (static_cast<::proxsuite::linalg::veg::tuple::TupleLeaf<I, __VA_ARGS__>&>( \
131 (Tuple).inner) \
132 .leaf_get())
133
134#define __VEG_IMPL_LEAF_ONCE(Tuple, I, ...) /* NOLINT */ \
135 (static_cast<__VA_ARGS__&&>( \
136 static_cast<::proxsuite::linalg::veg::tuple::TupleLeaf<I, __VA_ARGS__>&&>( \
137 (Tuple).inner) \
138 .leaf_get()))
139
140template<typename T, bool = (VEG_CONCEPT(empty<T>) && !VEG_CONCEPT(final<T>))>
142
143template<typename T>
144struct TupleLeafImpl<T, true> : T
145{
146 template<typename Fn>
149 : T{ VEG_FWD(fn)() }
150 {
151 }
152 TupleLeafImpl() = default;
153 VEG_INLINE constexpr auto leaf_get() const VEG_NOEXCEPT -> T&
154 {
155 return const_cast<T&>(static_cast<T const&>(*this));
156 }
157};
158template<typename T>
160{
162
163 template<typename Fn>
166 : leaf{ VEG_FWD(fn)() }
167 {
168 }
169 TupleLeafImpl() = default;
170
171 VEG_INLINE constexpr auto leaf_get() const VEG_NOEXCEPT -> T&
172 {
173 return const_cast<T&>(leaf);
174 }
175};
176
177template<usize I, typename T>
179{
180 using TupleLeafImpl<T>::TupleLeafImpl;
181};
182#endif
183
184namespace nb {
185struct unpack
186{
188 (typename Fn, typename... Ts, usize... Is),
189 requires(VEG_CONCEPT(
190 fn_once<Fn,
192 Ts&&...>)),
193 VEG_INLINE constexpr auto
194 operator(),
195 (args,
197 Ts...>&&),
198 (fn, Fn))
199 const VEG_NOEXCEPT_IF(
201 Fn,
203 Ts&&...>))
204 ->proxsuite::linalg::veg::meta::invoke_result_t<Fn, Ts&&...>
205 {
206
207 return VEG_FWD(fn)(__VEG_IMPL_LEAF_ONCE(args, Is, Ts)...);
208 }
209};
210
212{
214 (typename Fn, typename... Ts, usize... Is),
216 VEG_INLINE VEG_CPP14(constexpr) void
217 operator(),
218 (args,
220 Ts...>&&),
221 (fn, Fn))
222 const VEG_NOEXCEPT_IF(
224 {
226 }
227};
228
230{
232 (typename Fn, typename... Ts, usize... Is),
234 VEG_INLINE VEG_CPP14(constexpr) void
235 operator(),
236 (args,
238 Ts...>&&),
239 (fn, Fn))
241 {
243 }
244};
245
246struct map_i
247{
249 (typename Fn, typename... Ts, usize... Is),
250 requires(VEG_ALL_OF(VEG_CONCEPT(
251 fn_once< //
254 Ts>))),
255 VEG_NODISCARD VEG_INLINE VEG_CPP14(constexpr) auto
256 operator(),
257 (args,
259 Ts...>&&),
260 (fn, Fn))
261 const VEG_NOEXCEPT_IF(
266 Ts>)))
267 ->Tuple<
269 {
270 return { inplace[tuplify{}],
272 fn[Fix<isize{ Is }>{}],
273 __VEG_IMPL_LEAF_ONCE(args, Is, Ts) }... };
274 }
275};
276
277struct map
278{
280 (typename Fn, typename... Ts, usize... Is),
281 requires(VEG_ALL_OF(VEG_CONCEPT(
282 fn_mut<Fn,
284 Ts&&>))),
285 VEG_NODISCARD VEG_INLINE VEG_CPP14(constexpr) auto
286 operator(),
287 (args,
289 Ts...>&&),
290 (fn, Fn))
291 const VEG_NOEXCEPT_IF(
295 Ts&&>)))
297 {
298 return {
299 inplace[tuplify{}],
301 fn,
302 __VEG_IMPL_LEAF_ONCE(args, Is, Ts),
303 }...,
304 };
305 }
306};
307} // namespace nb
308
309template<usize... Is, typename... Ts>
310struct IndexedTuple<meta::index_sequence<Is...>, Ts...>
311{
312 struct _ : TupleLeaf<Is, Ts>...
313 {
314#if !defined(VEG_WITH_CXX17_SUPPORT)
315#if VEG_HAS_NO_UNIQUE_ADDRESS
316 template<typename... Fns>
317 VEG_INLINE constexpr _(InPlace<void> /* unused */, Fns... fns) noexcept(
319 : TupleLeaf<Is, Ts>{ VEG_FWD(fns)() }...
320 {
321 }
322#else
323 template<typename... Fns>
324 VEG_INLINE constexpr _(InPlace<void> /*unused*/, Fns... fns) noexcept(
326 : TupleLeaf<Is, Ts>{ inplace, VEG_FWD(fns) }...
327 {
328 }
329#endif
330 _() = default;
331#endif
332 } inner;
333
334 IndexedTuple() = default;
335
337 : inner{
338#if !defined(VEG_WITH_CXX17_SUPPORT)
339 inplace,
341#else
342#if VEG_HAS_NO_UNIQUE_ADDRESS
344#else
346#endif
347#endif
348 }
349 {
350 }
351
352 VEG_TEMPLATE((typename _, typename... Fns),
353 requires(VEG_CONCEPT(same<_, Tuplify>) &&
355 VEG_INLINE constexpr IndexedTuple,
356 (/*tag*/, InPlace<_>),
357 (... fns, Fns))
358
360 : inner{
361#if !defined(VEG_WITH_CXX17_SUPPORT)
362 inplace,
364#else
365#if VEG_HAS_NO_UNIQUE_ADDRESS
367#else
369#endif
370#endif
371 }
372 {
373 }
374
376
378 & VEG_NOEXCEPT->Tuple<Ref<Ts>...>
379 {
380 return {
381 tuplify,
382 ref(__VEG_IMPL_LEAF(*this, Is, Ts))...,
383 };
384 }
386 VEG_NOEXCEPT->Tuple<RefMut<Ts>...>
387 {
388 return {
389 tuplify,
390 mut(__VEG_IMPL_LEAF_MUT(*this, Is, Ts))...,
391 };
392 }
393
394 template<isize I>
395 void operator[](Fix<I> /*arg*/) const&& = delete;
396
398 requires(static_cast<usize>(I) < sizeof...(Ts)),
399 VEG_NODISCARD VEG_INLINE VEG_CPP14(constexpr) auto
400 operator[],
401 (/*arg*/, Fix<I>)) &&
403 VEG_CONCEPT(nothrow_movable<ith<static_cast<usize>(I), Ts...>>))
404 -> ith<static_cast<usize>(I), Ts...>
405 {
407 *this, static_cast<usize>(I), ith<static_cast<usize>(I), Ts...>);
408 }
409
411 requires(static_cast<usize>(I) < sizeof...(Ts)),
412 VEG_NODISCARD VEG_INLINE VEG_CPP14(constexpr) auto
413 operator[],
414 (/*arg*/, Fix<I>)) &
415 VEG_NOEXCEPT->ith<static_cast<usize>(I), Ts...>&
416 {
417 return __VEG_IMPL_LEAF_MUT(
418 *this, static_cast<usize>(I), ith<static_cast<usize>(I), Ts...>);
419 }
420
422 requires(static_cast<usize>(I) < sizeof...(Ts)),
423 VEG_NODISCARD VEG_INLINE VEG_CPP14(constexpr) auto
424 operator[],
425 (/*arg*/, Fix<I>))
426 const & VEG_NOEXCEPT->ith<static_cast<usize>(I), Ts...> const&
427 {
428 return __VEG_IMPL_LEAF(
429 *this, static_cast<usize>(I), ith<static_cast<usize>(I), Ts...>);
430 }
431};
432} // namespace tuple
433
434namespace _detail {
435namespace meta_ {
436
438{
439 static constexpr bool is_tuple = false;
440 static constexpr usize size = 0;
441 template<usize I>
442 using ith = void;
443 using seq = void;
444};
445
446template<typename... Ts>
448{
449 static constexpr bool is_tuple = true;
450 static constexpr usize size = sizeof...(Ts);
451 template<usize I>
453 using seq = meta::type_sequence<Ts...>;
455 using IndexedTuple = proxsuite::linalg::veg::tuple::
456 IndexedTuple<meta::make_index_sequence<sizeof...(Ts)>, Ts...>;
457};
458
460{
461 static auto test(void*) -> NonTupleBaseInfoImpl;
462 template<usize... Is, typename... Ts>
464 -> TupleBaseInfoImpl<Ts...>;
465};
466
467template<typename T>
469
470template<usize... Is, typename... Ts>
471struct IndexedToTuple<tuple::IndexedTuple<meta::index_sequence<Is...>, Ts...>>
472{
473 using Type = Tuple<Ts...>;
474};
475} // namespace meta_
476} // namespace _detail
477
478namespace tuple {
479namespace meta {
480template<typename T>
482 decltype(_detail::meta_::is_tuple_helper::test(static_cast<T*>(nullptr)));
483
484template<typename T>
485using is_tuple =
487template<typename T>
490
491template<usize I, typename T>
493
494} // namespace meta
495} // namespace tuple
496
497namespace concepts {
498namespace tuple {
500 tuple,
502} // namespace tuple
503} // namespace concepts
504
505template<typename... Ts>
506struct Tuple
507 : tuple::IndexedTuple<meta::make_index_sequence<sizeof...(Ts)>, Ts...>
508{
509
510 using Indexed =
511 tuple::IndexedTuple<meta::make_index_sequence<sizeof...(Ts)>, Ts...>;
512
513 using Indexed::Indexed;
514
516};
517
519namespace tuple {
520
521template<usize I, usize... Is, typename... Ts>
522VEG_NODISCARD VEG_INLINE constexpr auto
528template<usize I, usize... Is, typename... Ts>
529VEG_NODISCARD VEG_INLINE constexpr auto
535template<usize I, usize... Is, typename... Ts>
536VEG_NODISCARD VEG_INLINE constexpr auto
538 Ts...> const&& tup)
539 VEG_NOEXCEPT -> ith<I, Ts...> const&&
540{
541 return static_cast<ith<I, Ts...> const&&>(
543}
544template<usize I, usize... Is, typename... Ts>
545VEG_NODISCARD VEG_INLINE constexpr auto
551
552} // namespace tuple
553
554namespace _detail {
555namespace _tuple {
556template<usize... Is, typename... Ts>
557VEG_INLINE static constexpr auto
559 VEG_NOEXCEPT -> Tuple<Ts&&...>
560{
561 return {
562 ((void)(tup), tuplify),
563 __VEG_IMPL_LEAF_ONCE(tup, Is, Ts)...,
564 };
565}
566
567} // namespace _tuple
568} // namespace _detail
569
570namespace tuple {
571namespace nb {
572struct with
573{
575 typename... Fns,
576 requires(VEG_ALL_OF(VEG_CONCEPT(
578 VEG_NODISCARD VEG_INLINE constexpr auto
579 operator(),
580 (... args, Fns))
581 const VEG_NOEXCEPT_IF(
585 ->proxsuite::linalg::veg::Tuple<
587 {
588 return { inplace[tuplify{}], VEG_FWD(args)... };
589 }
590};
591
592struct zip
593{
594
595 template<typename... Tuples>
596 using PreZip =
598
599 template<typename... Tuples>
600 using Zip = proxsuite::linalg::veg::meta::
601 detected_t<PreZip, typename meta::TupleBaseInfo<Tuples>::Tuple...>;
602
604 (typename... Tuples),
605 requires(VEG_ALL_OF(VEG_CONCEPT(tuple::tuple<Tuples>)) &&
607 VEG_NODISCARD VEG_INLINE constexpr auto
608 operator(),
609 (... tups, Tuples))
610 const VEG_NOEXCEPT->Zip<Tuples...>
611 {
612 return zip::apply(
614 tups)...);
615 }
616
617private:
618 template<typename... Tuples>
619 VEG_INLINE static constexpr auto pre_apply(
621 Tuples&&... tups) VEG_NOEXCEPT -> Zip<Tuples...>
622 {
623 return zip::apply(VEG_FWD(tups)...);
624 }
625 template<typename... Tuples>
626 VEG_INLINE static constexpr auto pre_apply(
628 Tuples&&... tups) VEG_NOEXCEPT -> Zip<Tuples...>
629 {
630 return zip::from_ref_to_result(
632 Tuple,
634 zip::apply(_detail::_tuple::tuple_fwd(VEG_FWD(tups))...));
635 }
636
637 VEG_INLINE static auto apply() VEG_NOEXCEPT -> Tuple<> { return {}; }
638
639 template<usize I, typename T>
640 struct Helper
641 {
642 template<typename... Ts>
643 using Type = Tuple<T, meta::tuple_element<I, Ts>...>;
644
645 template<typename... Ts>
646 VEG_INLINE constexpr auto apply(Ts&&... tups) const VEG_NOEXCEPT
647 -> Type<Ts...>
648 {
649 return {
650 tuplify{},
651 VEG_FWD(first),
652 __VEG_IMPL_LEAF_ONCE(tups, I, meta::tuple_element<I, Ts>)...,
653 };
654 }
655 T&& first;
656 };
657
658 template<usize... Is, typename... Ts, typename... Tuples>
659 VEG_INLINE static constexpr auto apply(
661 first,
662 Tuples... rest) VEG_NOEXCEPT -> Tuple< //
663 typename Helper<Is, Ts>:: //
664 template Type<Tuples...>...>
665 {
666 return {
667 ((void)first, tuplify{}),
668 Helper<Is, Ts>{ __VEG_IMPL_LEAF_ONCE(first, Is, Ts) }
669 .template apply<Tuples...>(VEG_FWD(rest)...)...,
670 };
671 }
672
673 template<typename ISeq, typename... InnerTargets>
674 struct ConverterImpl;
675 template<typename OuterTarget>
676 struct Converter;
677
678 template<usize... Is, typename... InnerTargets>
679 struct ConverterImpl<proxsuite::linalg::veg::meta::index_sequence<Is...>,
680 InnerTargets...>
681 {
683 InnerTargets&&...>&& refs;
684
685 VEG_INLINE constexpr auto operator()() const
686 && VEG_NOEXCEPT->Tuple<InnerTargets...>
687 {
688
689 return {
690 inplace[tuplify{}],
691 _detail::MoveFn<InnerTargets>{
692 __VEG_IMPL_LEAF_ONCE(refs, Is, InnerTargets) }...,
693 };
694 }
695 };
696
697 template<typename... InnerTargets>
698 struct Converter<Tuple<InnerTargets...>>
699 {
700 using Type =
702 InnerTargets)>,
703 InnerTargets...>;
704 };
705
706 template<usize... Is, typename... Tups, typename... OuterTargets>
707 VEG_INLINE static constexpr auto from_ref_to_result(
708 Tag<Tuple<OuterTargets...>> /*tag*/,
710 zipped_refs) VEG_NOEXCEPT -> Tuple<OuterTargets...>
711 {
712 return {
713 ((void)zipped_refs, inplace[tuplify{}]),
714 typename Converter<OuterTargets>::Type{
715 __VEG_IMPL_LEAF_ONCE(zipped_refs, Is, Tups),
716 }...,
717 };
718 }
719};
720
721struct cat
722{
723
724 template<typename... Tuples>
725 using PreConcat =
727 template<typename... Tuples>
728 using Concat = proxsuite::linalg::veg::meta::
729 detected_t<PreConcat, typename meta::TupleBaseInfo<Tuples>::Tuple...>;
730
731 VEG_TEMPLATE((typename... Tuples),
732 requires(VEG_ALL_OF(VEG_CONCEPT(tuple::tuple<Tuples>))),
733 VEG_NODISCARD VEG_INLINE constexpr auto
734 operator(),
735 (... tups, Tuples))
736 const VEG_NOEXCEPT->Concat<Tuples...>
737 {
738 return cat::apply(
740 tups)...);
741 }
742
743private:
744 template<typename... Tuples>
745 VEG_INLINE static constexpr auto pre_apply(
747 Tuples&&... tups) VEG_NOEXCEPT -> Concat<Tuples...>
748 {
749 return cat::apply(VEG_FWD(tups)...);
750 }
751
752 template<typename... Tuples>
753 VEG_INLINE static constexpr auto pre_apply(
755 Tuples&&... tups) VEG_NOEXCEPT -> Concat<Tuples...>
756 {
757 return cat::template from_ref_to_result(
759 cat::apply(_detail::_tuple::tuple_fwd(VEG_FWD(tups))...));
760 }
761
762 template<typename... Targets, usize... Is, typename... Refs>
763 VEG_INLINE static constexpr auto from_ref_to_result(
764 Tag<Tuple<Targets...>> /*tag*/,
767 {
768 return {
769 inplace[tuplify{}],
770 _detail::MoveFn<Targets>{ __VEG_IMPL_LEAF_ONCE(refs, Is, Targets) }...,
771 };
772 }
773
774 VEG_INLINE static auto apply() VEG_NOEXCEPT -> Tuple<> { return {}; }
775
776 template<usize... Is, typename... Ts, typename... Tuples>
777 VEG_INLINE static constexpr auto apply(
779 first,
780 Tuples&&... rest)
782 Tuple,
783 Tuple<Ts...>,
784 typename _detail::meta_::IndexedToTuple<Tuples>::Type...>
785 {
786 return cat::apply2(VEG_FWD(first), cat::apply(VEG_FWD(rest)...));
787 }
788
789 template<usize... Is, typename... Ts, usize... Js, typename... Us>
790 VEG_INLINE static constexpr auto apply2(
792 first,
794 second) VEG_NOEXCEPT -> Tuple<Ts..., Us...>
795 {
796 return {
797 tuplify{},
798 __VEG_IMPL_LEAF_ONCE(first, Is, Ts)...,
799 __VEG_IMPL_LEAF_ONCE(second, Js, Us)...,
800 };
801 }
802};
803
824} // namespace nb
826
829
831
832VEG_NIEBLOID(for_each);
833VEG_NIEBLOID(for_each_i);
836
837VEG_NIEBLOID(deref_assign);
838} // namespace tuple
839
840namespace cpo {
841template<usize... Is, typename... Ts>
843 tuple::IndexedTuple<meta::index_sequence<Is...>, Ts...>>
844 : meta::bool_constant<(VEG_ALL_OF(is_trivially_relocatable<Ts>::value))>
845{};
846template<usize... Is, typename... Ts>
848 tuple::IndexedTuple<meta::index_sequence<Is...>, Ts...>>
849 : meta::bool_constant<(VEG_ALL_OF(is_trivially_constructible<Ts>::value))>
850{};
851
852template<typename... Ts>
853struct is_trivially_relocatable<tuple::Tuple<Ts...>>
854 : meta::bool_constant<(VEG_ALL_OF(is_trivially_relocatable<Ts>::value))>
855{};
856template<typename... Ts>
858 : meta::bool_constant<(VEG_ALL_OF(is_trivially_constructible<Ts>::value))>
859{};
860} // namespace cpo
861} // namespace veg
862} // namespace linalg
863} // namespace proxsuite
864
865template<typename... Ts>
866struct std::tuple_size<proxsuite::linalg::veg::Tuple<Ts...>>
867 : ::proxsuite::linalg::veg::meta::constant<proxsuite::linalg::veg::usize,
868 sizeof...(Ts)>
869{};
870template<proxsuite::linalg::veg::usize I, typename... Ts>
871struct std::tuple_element<I, proxsuite::linalg::veg::Tuple<Ts...>>
872{
874};
875
877#endif /* end of include guard VEG_TUPLE_HPP_B8PHUNWES */
#define VEG_ALL_OF(...)
Definition macros.hpp:177
#define VEG_EVAL_ALL(...)
Definition macros.hpp:191
#define VEG_CONCEPT(...)
Definition macros.hpp:1243
#define VEG_NIEBLOID(Name)
Definition macros.hpp:545
#define VEG_INLINE
Definition macros.hpp:118
#define VEG_NO_UNIQUE_ADDRESS
Definition macros.hpp:110
#define VEG_FWD(X)
Definition macros.hpp:569
#define VEG_DECLVAL(...)
Definition macros.hpp:131
#define VEG_DEF_CONCEPT(Tpl, Name,...)
Definition macros.hpp:321
static VEG_INLINE constexpr auto tuple_fwd(tuple::IndexedTuple< meta::index_sequence< Is... >, Ts... > &&tup) VEG_NOEXCEPT -> Tuple< Ts &&... >
Definition tuple.hpp:558
_detail::_meta::make_integer_sequence< usize, N > * make_index_sequence
typename _detail::_meta::concat_type_seq< bool_constant< VEG_ALL_OF(_detail::_meta::specializes< F, Seqs >::value)>, F, Seqs... >::type type_sequence_cat
typename _detail::_meta::zip_type_seq< meta::bool_constant< VEG_ALL_OF(_detail::_meta::specializes< F, Seqs >::value) && VEG_CONCEPT( all_same< constant< usize, _detail::_meta::specialize_len< F, Seqs >::value >... >)>, F, Seqs... >::type type_sequence_zip
proxsuite::linalg::veg::meta::constant< usize, TupleBaseInfo< T >::size > tuple_size
Definition tuple.hpp:488
decltype(_detail::meta_::is_tuple_helper::test(static_cast< T * >(nullptr))) TupleBaseInfo
Definition tuple.hpp:481
typename TupleBaseInfo< T >::template ith< I > tuple_element
Definition tuple.hpp:492
VEG_NODISCARD VEG_INLINE constexpr auto get(tuple::IndexedTuple< proxsuite::linalg::veg::meta::index_sequence< Is... >, Ts... > const &tup) VEG_NOEXCEPT -> ith< I, Ts... > const &
Definition tuple.hpp:523
typename _detail::pack_ith_elem< I >::template Type< Ts... > ith
_detail::_meta::make_signed< usize >::Type isize
Definition typedefs.hpp:43
decltype(sizeof(0)) usize
Definition macros.hpp:702
STL namespace.
#define VEG_NODISCARD
Definition prologue.hpp:97
#define VEG_NOEXCEPT
Definition prologue.hpp:30
#define VEG_CPP14(...)
Definition prologue.hpp:71
#define VEG_CPP17(...)
Definition prologue.hpp:77
#define VEG_NOEXCEPT_LIKE(Expr)
Definition prologue.hpp:34
#define VEG_NOEXCEPT_IF(...)
Definition prologue.hpp:31
proxsuite::linalg::veg::tuple:: IndexedTuple< meta::make_index_sequence< sizeof...(Ts)>, Ts... > IndexedTuple
Definition tuple.hpp:455
static auto test(tuple::IndexedTuple< meta::index_sequence< Is... >, Ts... > *) -> TupleBaseInfoImpl< Ts... >
static auto test(void *) -> NonTupleBaseInfoImpl
proxsuite::linalg::veg::tuple::IndexedTuple< meta::index_sequence< Is... >, Ts... >::_ inner
VEG_TEMPLATE((typename _, typename... Fns), requires(VEG_CONCEPT(same< _, Tuplify >) &&VEG_ALL_OF(VEG_CONCEPT(fn_once< Fns, Ts >))), VEG_INLINE constexpr IndexedTuple,(, InPlace< _ >),(... fns, Fns)) VEG_NOEXCEPT_IF(VEG_ALL_OF(VEG_CONCEPT(nothrow_fn_once< Fns
VEG_TEMPLATE((isize I), requires(static_cast< usize >(I)< sizeof...(Ts)), VEG_NODISCARD VEG_INLINE VEG_CPP14(constexpr) auto operator[],(, Fix< I >)) const &VEG_NOEXCEPT -> ith< static_cast< usize >(I), Ts... > const &
Definition tuple.hpp:421
VEG_TEMPLATE((isize I), requires(static_cast< usize >(I)< sizeof...(Ts)), VEG_NODISCARD VEG_INLINE VEG_CPP14(constexpr) auto operator[],(, Fix< I >)) &&VEG_NOEXCEPT_IF(VEG_CONCEPT(nothrow_movable< ith< static_cast< usize >(I)
VEG_NODISCARD VEG_INLINE VEG_CPP14(constexpr) auto as_ref() const &VEG_NOEXCEPT -> Tuple< Ref< Ts >... >
Definition tuple.hpp:377
VEG_NODISCARD VEG_INLINE VEG_CPP14(constexpr) auto as_mut() VEG_NOEXCEPT -> Tuple< RefMut< Ts >... >
Definition tuple.hpp:385
VEG_TEMPLATE((isize I), requires(static_cast< usize >(I)< sizeof...(Ts)), VEG_NODISCARD VEG_INLINE VEG_CPP14(constexpr) auto operator[],(, Fix< I >)) &VEG_NOEXCEPT -> ith< static_cast< usize >(I), Ts... > &
Definition tuple.hpp:410
VEG_INLINE constexpr IndexedTuple(Tuplify, Ts... args) VEG_NOEXCEPT
Definition tuple.hpp:336
VEG_INLINE constexpr _(InPlace< void >, Fns... fns) noexcept(VEG_ALL_OF(VEG_CONCEPT(nothrow_fn_once< Fns, Ts >)))
Definition tuple.hpp:324
VEG_INLINE constexpr auto leaf_get() const VEG_NOEXCEPT -> T &
Definition tuple.hpp:171
VEG_INLINE constexpr TupleLeafImpl(InPlace< void >, Fn fn) VEG_NOEXCEPT_LIKE(VEG_FWD(fn)())
Definition tuple.hpp:164
VEG_INLINE constexpr TupleLeafImpl(InPlace< void >, Fn fn) VEG_NOEXCEPT_LIKE(VEG_FWD(fn)())
Definition tuple.hpp:147
VEG_INLINE constexpr auto leaf_get() const VEG_NOEXCEPT -> T &
Definition tuple.hpp:153
VEG_TEMPLATE((typename... Tuples), requires(VEG_ALL_OF(VEG_CONCEPT(tuple::tuple< Tuples >))), VEG_NODISCARD VEG_INLINE constexpr auto operator(),(... tups, Tuples)) const VEG_NOEXCEPT -> Concat< Tuples... >
Definition tuple.hpp:731
proxsuite::linalg::veg::meta::type_sequence_cat< Tuple, Tuples... > PreConcat
Definition tuple.hpp:725
proxsuite::linalg::veg::meta:: detected_t< PreConcat, typename meta::TupleBaseInfo< Tuples >::Tuple... > Concat
Definition tuple.hpp:728
VEG_TEMPLATE((typename... Ts, typename... Us, usize... Is), requires(VEG_ALL_OF(VEG_CONCEPT(assignable< Ts &, Us const & >))), VEG_INLINE VEG_CPP14(constexpr) void operator(),(ts, IndexedTuple< proxsuite::linalg::veg::meta::index_sequence< Is... >, RefMut< Ts >... >),(us, IndexedTuple< proxsuite::linalg::veg::meta::index_sequence< Is... >, Ref< Us >... >)) const VEG_NOEXCEPT_IF(VEG_ALL_OF(VEG_CONCEPT(nothrow_assignable< Ts &
VEG_TEMPLATE((typename Fn, typename... Ts, usize... Is), requires(VEG_ALL_OF(VEG_CONCEPT(fn_once< inner_ith< Fn &, Is >, void, Ts >))), VEG_INLINE VEG_CPP14(constexpr) void operator(),(args, IndexedTuple< proxsuite::linalg::veg::meta::index_sequence< Is... >, Ts... > &&),(fn, Fn)) const VEG_NOEXCEPT_IF(VEG_ALL_OF(VEG_CONCEPT(nothrow_fn_once< inner_ith< Fn
VEG_TEMPLATE((typename Fn, typename... Ts, usize... Is), requires(VEG_ALL_OF(VEG_CONCEPT(fn_mut< Fn, void, Ts && >))), VEG_INLINE VEG_CPP14(constexpr) void operator(),(args, IndexedTuple< proxsuite::linalg::veg::meta::index_sequence< Is... >, Ts... > &&),(fn, Fn)) const VEG_NOEXCEPT_IF(VEG_ALL_OF(VEG_CONCEPT(nothrow_fn_mut< Fn
VEG_TEMPLATE((typename Fn, typename... Ts, usize... Is), requires(VEG_ALL_OF(VEG_CONCEPT(fn_once< inner_ith< Fn &, Is >, proxsuite::linalg::veg::meta::invoke_result_t< inner_ith< Fn &, Is >, Ts >, Ts >))), VEG_NODISCARD VEG_INLINE VEG_CPP14(constexpr) auto operator(),(args, IndexedTuple< proxsuite::linalg::veg::meta::index_sequence< Is... >, Ts... > &&),(fn, Fn)) const VEG_NOEXCEPT_IF(VEG_ALL_OF(VEG_CONCEPT(nothrow_fn_once< inner_ith< Fn &
VEG_TEMPLATE((typename Fn, typename... Ts, usize... Is), requires(VEG_ALL_OF(VEG_CONCEPT(fn_mut< Fn, proxsuite::linalg::veg::meta::invoke_result_t< Fn &, Ts && >, Ts && >))), VEG_NODISCARD VEG_INLINE VEG_CPP14(constexpr) auto operator(),(args, IndexedTuple< proxsuite::linalg::veg::meta::index_sequence< Is... >, Ts... > &&),(fn, Fn)) const VEG_NOEXCEPT_IF(VEG_ALL_OF(VEG_CONCEPT(nothrow_fn_mut< Fn
VEG_NODISCARD VEG_INLINE constexpr auto operator()(Ts... args) const VEG_NOEXCEPT -> proxsuite::linalg::veg::Tuple< Ts... >
Definition tuple.hpp:75
VEG_TEMPLATE((typename Fn, typename... Ts, usize... Is), requires(VEG_CONCEPT(fn_once< Fn, proxsuite::linalg::veg::meta::invoke_result_t< Fn, Ts &&... >, Ts &&... >)), VEG_INLINE constexpr auto operator(),(args, IndexedTuple< proxsuite::linalg::veg::meta::index_sequence< Is... >, Ts... > &&),(fn, Fn)) const VEG_NOEXCEPT_IF(VEG_CONCEPT(nothrow_fn_once< Fn
VEG_TEMPLATE(typename... Fns, requires(VEG_ALL_OF(VEG_CONCEPT(fn_once< Fns, proxsuite::linalg::veg::meta::invoke_result_t< Fns > >))), VEG_NODISCARD VEG_INLINE constexpr auto operator(),(... args, Fns)) const VEG_NOEXCEPT_IF(VEG_ALL_OF(VEG_CONCEPT(nothrow_fn_once< Fns
proxsuite::linalg::veg::meta::type_sequence_zip< Tuple, Tuples... > PreZip
Definition tuple.hpp:596
VEG_TEMPLATE((typename... Tuples), requires(VEG_ALL_OF(VEG_CONCEPT(tuple::tuple< Tuples >)) &&VEG_CONCEPT(all_same< tuple::meta::tuple_size< Tuples >... >)), VEG_NODISCARD VEG_INLINE constexpr auto operator(),(... tups, Tuples)) const VEG_NOEXCEPT -> Zip< Tuples... >
Definition tuple.hpp:603
proxsuite::linalg::veg::meta:: detected_t< PreZip, typename meta::TupleBaseInfo< Tuples >::Tuple... > Zip
Definition tuple.hpp:600
#define __VEG_IMPL_LEAF_ONCE(Tuple, I,...)
Definition tuple.hpp:134
#define __VEG_IMPL_LEAF_MUT(Tuple, I,...)
Definition tuple.hpp:129
#define __VEG_IMPL_LEAF(Tuple, I,...)
Definition tuple.hpp:122