acme
Foundational cross-platform layer of the ca2 framework
Loading...
Searching...
No Matches
_initial_concepts.h
1// Created by camilo on 2022-11-22 <3ThomasBorregaardSorensen!!
2//
3// _numeric_concepts.h
4// acme
5//
6// Created by Camilo Sasuke Thomas Borregaard Soerensen on 29/11/22.
7// Copyright (c) 2022 Camilo Sasuke Tsumanuma. All rights reserved.
8//
9#pragma once
10
11
12struct point2_t{};
13struct size2_t{};
14struct matrix_t{};
15
16
17#include <format>
18#include <compare>
19
20
21
22template < typename ITERATOR_TYPE >
24
25
26
27template < typename SEQUENCE >
28concept prototype_sequence = ::is_same < typename SEQUENCE::sequence_tag, sequence_t >;
29
30template<typename SEQUENCE2>
31concept prototype_sequence2 = requires(SEQUENCE2 s2) {
32
33 s2.x;
34 s2.y;
35
36};
37template<typename SEQUENCE3>
38concept prototype_sequence3 = requires(SEQUENCE3 s3) {
39 s3.x;
40 s3.y;
41 s3.z;
42};
43template<typename SEQUENCE4>
44concept prototype_sequence4 = requires(SEQUENCE4 s4) {
45 s4.x;
46 s4.y;
47 s4.z;
48 s4.w;
49};
50
51
52template<typename ENUM>
54 std::is_enum<::decay<ENUM>>::value;
55
56template<typename ENUMERATION>
58 ::is_same<typename ENUMERATION::ENUM_TYPE_TAG, enum_type_t>;
59
60template<typename CFLAG>
61concept prototype_c_flag = ::is_same<typename CFLAG::CFLAG_TYPE_TAG, c_flag_type_t>;
62
63template < typename ENUM >
65 prototype_raw_enum < ENUM >
66 || prototype_enumeration < ENUM >
67 || prototype_c_flag < ENUM >;
68
69
70template < typename BLOCK >
71concept prototype_block = ::is_same<typename BLOCK::PRIMITIVE_BLOCK_TAG, PRIMITIVE_BLOCK_TAG_TYPE >;
72
73template< typename RAW_ARRAY >
74concept prototype_raw_array = ::is_raw_array < RAW_ARRAY>;
75
76
77//template < typename T >
78//concept prototype_integral_up_to_32_bit =
79//(std::is_integral_v < T > ||
80//std::is_enum < T >::value ||
81//::is_same < T, ::e_status >::value) && sizeof(T) <= 4;
82
83template < typename T >
85(std::is_integral_v < T >) && sizeof(T) <= 4;
86
87template < typename T >
88concept prototype_integer = std::is_integral < T >::value;
89
90template < typename T >
91concept prototype_natural = std::is_integral < T >::value && !std::is_signed < T >::value;
92
93template < typename T >
94concept prototype_signed = std::is_integral < T >::value && std::is_signed < T >::value;
95
96template < typename T >
97concept prototype_signed_not_8bit = prototype_signed < T > && sizeof(T) != 1;
98
99template < typename T >
100concept prototype_unsigned = std::is_integral < T >::value && !std::is_signed < T >::value;
101
102template < typename T >
103concept prototype_unsigned_not_8bit = prototype_unsigned < T > && sizeof(T) != 1;
104
105template < typename FLOATING >
106concept prototype_floating = std::is_floating_point < ::decay < FLOATING > >::value;
107
108
109
110template < typename AGGREGATE >
111concept prototype_aggregate = ::std::is_aggregate_v < AGGREGATE >;
112
113
114template < typename T >
115concept prototype_fundamental = std::is_fundamental < T >::value || std::is_pointer < T >::value;
116
117template < typename T >
118concept prototype_type = !std::is_fundamental < T >::value && !std::is_pointer < T >::value;
119
120template<typename ITERATOR_TYPE>
121class range;
122
123template < typename T >
124concept prototype_range = ::std::is_base_of_v < ::range< typename T::this_iterator >, T >;
125
126template < typename T >
127concept std_range = requires(const T &t)
128{
129t.begin();
130 t.end();
131
132};
133
134
135template < typename T, typename ITERATOR_TYPE >
136concept typed_range =
137prototype_range < T >
138|| ::is_same < non_const < ITERATOR_TYPE >, non_const < typename T::this_iterator > >;
139
140
141template < typename FROM, typename TO >
142concept castable_to =
143::std::is_convertible < FROM, TO >::value ||
144::std::is_convertible < FROM, const TO >::value;
145
146template < typename FROM, typename TO >
147concept non_castable_to = !castable_to < FROM, TO >;
148
149
150template < typename FROM, typename TO >
152::std::is_convertible < ::decay < FROM > *, TO >::value;
153
154
155template < typename FROM, typename TO >
156concept pointer_not_castable_to = !pointer_castable_to < FROM, TO >;
157
158
159template < typename FROM, typename TO_POINTER >
161::std::is_convertible < FROM, TO_POINTER * >::value ||
162::std::is_convertible < FROM, const TO_POINTER * >::value;
163
164template < typename FROM, typename TO_POINTER >
165concept non_raw_pointer_castable = !raw_pointer_castable < FROM, TO_POINTER >;
166
167
168template < typename T >
170 ::is_same < ::non_const<T>, ::i8> ||
171 ::is_same < ::non_const<T>, char8_t> ||
172 ::is_same < ::non_const<T>, wchar_t> ||
173 ::is_same < ::non_const<T>, ::ansi_character> ||
174 ::is_same < ::non_const<T>, ::wd16_character> ||
175 ::is_same < ::non_const<T>, ::wd32_character>;
176
177template<typename T>
179 ::is_raw_pointer<T>
180 && ::is_const<::non_pointer<T>>
182
183template<typename T>
185{
186};
187
188
189
190
191template<typename CHARACTER, std::size_t N>
193struct is_const_prototype_character_array<const CHARACTER[N]> : ::true_type
194{
195 using char_type = CHARACTER;
196 static constexpr std::size_t size = N;
197};
198
199
200
201template<typename T>
203{
204};
205
206
207
208template<typename NONCHARACTER, std::size_t N>
210 struct is_const_non_prototype_character_array<const NONCHARACTER[N]> : ::true_type
211{
212 using type = NONCHARACTER;
213 static constexpr std::size_t size = N;
214};
215
216
217
218template<typename T>
220{
221};
222template<typename NONCHARACTER, std::size_t N>
224 struct is_non_prototype_character_array<NONCHARACTER[N]> : ::true_type
225{
226 using type = NONCHARACTER;
227 static constexpr std::size_t size = N;
228};
229
230
231template<typename NONCHARACTER, std::size_t N>
233 struct is_non_prototype_character_array<const NONCHARACTER[N]> : ::true_type
234{
235 using type = NONCHARACTER;
236 static constexpr std::size_t size = N;
237};
238
239
240template<typename T>
241concept const_array_of_prototype_character = is_const_prototype_character_array<T>::payload;
242
243template<typename T>
244concept const_array_of_non_prototype_character = is_const_non_prototype_character_array<T>::payload;
245
246template<typename T>
248 ::prototype_raw_array<T> &&
250
251
252template < typename T >
254::is_same < T, ::u8 * > ||
255::is_same < T, char_pointer > ||
256::is_same < T, char8_t * > ||
257::is_same < T, wchar_t * > ||
258::is_same < T, ::ansi_character * > ||
259::is_same < T, ::wd16_character * > ||
260::is_same < T, ::wd32_character * > ||
261::is_same < T, const ::u8 * > ||
262::is_same < T, const_char_pointer > ||
263::is_same < T, const char8_t * > ||
264::is_same < T, const wchar_t * > ||
265::is_same < T, const_char_pointer > ||
266::is_same < T, const ::wd16_character * > ||
267::is_same < T, const ::wd32_character * >;
268
269
270template < typename T >
272::is_same < T, ::u8 * & > ||
273::is_same < T, char_pointer & > ||
274::is_same < T, char8_t *& > ||
275::is_same < T, wchar_t * & > ||
276::is_same < T, ::ansi_character * & > ||
277::is_same < T, ::wd16_character * & > ||
278::is_same < T, ::wd32_character * & > ||
279::is_same < T, const ::u8 * & > ||
280::is_same < T, const_char_pointer &> ||
281::is_same < T, const char8_t *& > ||
282::is_same < T, const wchar_t * & > ||
283::is_same < T, const_char_pointer &> ||
284::is_same < T, const ::wd16_character * & > ||
285::is_same < T, const ::wd32_character * & >;
286
287
288template < typename T, typename CHARACTER >
290::is_same < T, CHARACTER*& > ||
291::is_same < T, const CHARACTER*& >;
292
293template < typename T, typename CHARACTER >
295prototype_character < T > &&
296!::is_same < T, CHARACTER*& > &&
297!::is_same < T, const CHARACTER*& >;
298
299template < typename T, typename CHARACTER >
301prototype_character < T > &&
302!::is_same < T, CHARACTER >;
303
304
305template < typename CHARACTER_POINTER >
307::std::is_pointer_v<CHARACTER_POINTER>
308&& !::std::is_array_v<CHARACTER_POINTER>
310
311
312template < typename TYPED_CHARACTER_POINTER, typename CHARACTER >
314::std::is_pointer_v<TYPED_CHARACTER_POINTER>
315&& !::std::is_array_v<TYPED_CHARACTER_POINTER>
316&& ::is_same < ::non_const<CHARACTER>, ::non_const <::non_pointer<TYPED_CHARACTER_POINTER>>>;
317
318
319template < typename OTHER_CHARACTER_POINTER, typename CHARACTER >
321::std::is_pointer_v<OTHER_CHARACTER_POINTER>
322&& !::std::is_array_v<OTHER_CHARACTER_POINTER>
324&& !::is_same < CHARACTER, ::non_const <::non_pointer<OTHER_CHARACTER_POINTER>>>;
325
326
327//template < typename CHARACTER_POINTER >
328//concept character_array =
329//::std::is_pointer_v<CHARACTER_POINTER>
330//&& ::std::is_array_v<CHARACTER_POINTER>
331//&& prototype_character<::non_const <::non_pointer<CHARACTER_POINTER>>>;
332//
333//
334//template < typename TYPED_CHARACTER_POINTER, typename CHARACTER >
335//concept typed_character_array =
336//::std::is_pointer_v<TYPED_CHARACTER_POINTER>
337//&& ::std::is_array_v<CHARACTER_POINTER>
338//&& ::is_same < CHARACTER, ::non_const <::non_pointer<TYPED_CHARACTER_POINTER>>>;
339
340template < typename ITERATOR_TYPE >
341class character_range;
342
343template <typename ITERATOR_TYPE>
344struct std::formatter<::character_range<ITERATOR_TYPE>>;
345
346
347
348template <typename T>
350 std::is_pointer<T>::value &&
351 requires {
352 typename non_const<non_pointer<T>>;
353 } &&
354 (
355 std::same_as<non_const<non_pointer<T>>, ::i8> ||
356 std::same_as<non_const<non_pointer<T>>, wchar_t> ||
357 std::same_as<non_const<non_pointer<T>>, char8_t> ||
358 std::same_as<non_const<non_pointer<T>>, char16_t> ||
359 std::same_as<non_const<non_pointer<T>>, char32_t>
360 );
361
362template < typename STDSTRING >
363concept prototype_std_string = (::std::is_base_of_v<::std::string, STDSTRING > || ::std::is_base_of_v<::std::wstring, STDSTRING >);
364
365
366template < typename CHARACTER_RANGE >
368(::std::is_base_of_v < ::character_range< const typename CHARACTER_RANGE::CHARACTER* >, CHARACTER_RANGE >
369&& prototype_character < typename CHARACTER_RANGE::CHARACTER > )||
370(::is_same < ::character_range< const typename CHARACTER_RANGE::ITEM* >, CHARACTER_RANGE > &&
371prototype_character < typename CHARACTER_RANGE::ITEM >);
372
373
374
375template < typename TYPED_CHARACTER_RANGE, typename CHARACTER >
377(::std::is_base_of_v < ::character_range< const CHARACTER* >, TYPED_CHARACTER_RANGE >
378 || ::is_same < ::character_range< const CHARACTER* >, TYPED_CHARACTER_RANGE >)
379 && prototype_character < CHARACTER >;
380
381
382template < typename OTHER_CHARACTER_RANGE, typename CHARACTER >
384(::std::is_base_of_v < ::character_range< const typename OTHER_CHARACTER_RANGE::CHARACTER* >, OTHER_CHARACTER_RANGE >
385 && other_primitive_character < typename OTHER_CHARACTER_RANGE::CHARACTER, CHARACTER >) ||
386 (::is_same < ::character_range< const typename OTHER_CHARACTER_RANGE::ITEM* >, OTHER_CHARACTER_RANGE > &&
387 other_primitive_character < typename OTHER_CHARACTER_RANGE::ITEM, CHARACTER >);
388
389
391
392template < typename ITERATOR >
393concept prototype_iterator = ::is_same<typename ITERATOR::TYPE_TAG, ITERATOR_TYPE_TAG >;
394
395
396template < typename TYPE >
397struct for_type {};
398
399
400namespace comparison
401{
402
403
404 template < typename ORDERING, typename TYPE >
405 concept ordering = ::is_same<typename ORDERING::ORDERING, for_type < TYPE > >;
406
407 template < typename EQUALITY, typename TYPE >
408 concept equality = ::is_same<typename EQUALITY::EQUALITY, for_type < TYPE > >;
409
410
411 constexpr bool done_with_result(bool bEqual) { return !bEqual; }
412
413
414 constexpr bool done_with_result(std::strong_ordering order) { return order != 0; }
415
416
417 template < typename COMPARISON >
418 constexpr auto tuple(COMPARISON comparison)
419 {
420
421 return comparison();
422
423 }
424
425
426 template<typename COMPARISON, typename... Args>
427 constexpr auto tuple(COMPARISON comparison, Args... args) // recursive variadic function
428 {
429
430 auto result = comparison();
431
432 if (done_with_result(result))
433 {
434
435 return result;
436
437 }
438
439 return tuple(args...);
440
441 }
442
443
444} // namespace comparison
445
446
447
448template < typename ITERATOR >
449class string_base;
450
451
452using ansi_string = string_base < const_char_pointer >;
453using wd16_string = string_base < const ::wd16_character * >;
454using wd32_string = string_base < const ::wd32_character * >;
455using wide_string = string_base < const ::wide_character * >;
456using string = ::ansi_string;
457using wstring = ::wide_string;
458
459
460
461template < typename HAS_AS_STRING >
462concept has_as_string = requires(HAS_AS_STRING has_as_string)
463{
464
465 { has_as_string.as_string() } -> ::std::same_as <::string>;
466
467};
468
469template < typename HAS_GET_STRING >
470concept has_get_string = requires(HAS_GET_STRING has_get_string)
471{
472
473 { has_get_string.get_string() } -> ::std::same_as <::string>;
474
475};
476
477
478
479//template <typename HANDLER, typename ITEM>
480//concept ::comparison::comparison =
481//::is_same<typename HANDLER::ORDERING, ORDERING_HANDLER_TAG >
482//&& ::is_same<typename HANDLER::ORDERING, ORDERING_HANDLER_TAG >;
483
484
485//template <typename COMPARE_ITEM, typename ITEM>
486//concept compare_predicate = ::std::convertible_to<COMPARE_ITEM,::function<::std::strong_ordering(ITEM, ITEM)> >
487//|| ::std::convertible_to<COMPARE_ITEM,::std::function< ::strong_ordering(const ITEM &, const ITEM &)>>;
488//
489//
490
491
492//template < typename BLOCK >
493//concept prototype_block = requires(BLOCK block)
494//{
495//
496// block.data();
497// block.size();
498// block.length_in_bytes();
499//
500//};
501
502
503//#ifdef __ANDROID__
504//
505//namespace std
506//{
507// template<class FROM, class TO>
508// concept convertible_to = ::std::is_convertible_v<FROM, TO>;
509//
510//}
511//#endif
512
513
514
515//template < typename TYPED_BLOCK, typename ITEM_TYPE >
516//concept typed_block = requires(TYPED_BLOCK typed_block, ITEM_TYPE item_type)
517//{
518//
519// { typed_block.data() }->::std::convertible_to<ITEM_TYPE*>;
520// typed_block.size();
521// typed_block.length_in_bytes();
522//
523//};
524
525//template < typename CONTAINER >
526//concept prototype_container = ::is_same < typename CONTAINER::PRIMITIVE_CONTAINER_TAG, PRIMITIVE_CONTAINER_TAG_TYPE >;
527
528template < typename PAYLOAD >
530::std::is_base_of_v < ::payload, PAYLOAD >
531|| ::is_same < ::payload, PAYLOAD >;
532
533
534template < typename A_CONST >
535concept prototype_const = ::std::is_const < A_CONST > ::value;
536
537template < typename NON_CONST >
538concept prototype_non_const = !prototype_const < NON_CONST >;
539
540template < typename HAS_AS_STRING_NOT_PAYLOAD >
541concept has_as_string_not_payload = has_as_string < HAS_AS_STRING_NOT_PAYLOAD > && !prototype_payload<HAS_AS_STRING_NOT_PAYLOAD>;
542
543
544template < typename ATOM >
545concept prototype_atom = ::is_same < typename ATOM::PRIMITIVE_ATOM_TAG, PRIMITIVE_ATOM_TAG_TYPE >;
546
547template < typename STRING >
548concept prototype_string = ::is_same < typename STRING::PRIMITIVE_STRING_TAG, PRIMITIVE_STRING_TAG_TYPE >;
549
550template < typename TYPED_PRIMITIVE_STRING, typename CHARACTER >
552(::std::is_base_of_v < ::string_base< const CHARACTER* >, TYPED_PRIMITIVE_STRING >
553 || ::is_same < ::string_base< const CHARACTER* >, TYPED_PRIMITIVE_STRING >)
554 && prototype_character < CHARACTER >;
555
556
557template < typename OTHER_PRIMITIVE_STRING, typename CHARACTER >
559(::std::is_base_of_v < ::string_base< const typename OTHER_PRIMITIVE_STRING::CHARACTER* >, OTHER_PRIMITIVE_STRING >
560 && other_primitive_character < typename OTHER_PRIMITIVE_STRING::CHARACTER, CHARACTER >) ||
561 (::is_same < ::string_base< const typename OTHER_PRIMITIVE_STRING::ITEM* >, OTHER_PRIMITIVE_STRING > &&
562 other_primitive_character < typename OTHER_PRIMITIVE_STRING::ITEM, CHARACTER >);
563
564template < typename SCOPED_STRING >
565concept prototype_scoped_string = ::is_same < typename SCOPED_STRING::PRIMITIVE_SCOPED_STRING_TAG, PRIMITIVE_SCOPED_STRING_TAG_TYPE >;
566
567
568
569template < typename T >
571
572
573template < typename T >
575
576
577template<typename NUMBER>
581
582
583template < typename NUMBER >
584concept prototype_number =
585prototype_integral < NUMBER > ||
586prototype_floating < NUMBER > ||
587prototype_enum < NUMBER >;
588
589
590template < typename POINT >
591concept raw_primitive_point = requires(POINT point)
592{
593 { point.x }->prototype_number;
594 { point.y }->prototype_number;
595};
596
597
598template < typename POINT >
599concept function_point = requires(POINT point)
600{
601 { point.semantic_t() } ->::std::convertible_to<point2_t>;
602 { point.x() }->prototype_number;
603 { point.y() }->prototype_number;
604};
605
606template < typename POINT >
607concept struct_point = requires(POINT point)
608{
609 { point.semantic_t() } ->::std::convertible_to<point2_t>;
610 { point.x }->prototype_number;
611 { point.y }->prototype_number;
612};
613
614
615template < typename POINT >
617
618
619//template < typename SEQUENCE2 >
620//concept prototype_sequence2 =
621// ::is_same < typename SEQUENCE2::sequence_tag, sequence_t > &&
622// ::is_same < typename SEQUENCE2::sequence_size, sequence_size_t < 2 > >;
623//
624//
625//template < typename SEQUENCE3 >
626//concept prototype_sequence3 =
627// ::is_same < typename SEQUENCE3::sequence_tag, sequence_t > &&
628// ::is_same < typename SEQUENCE3::sequence_size, sequence_size_t < 3 > >;
629//
630//
631//template < typename SEQUENCE4 >
632//concept prototype_sequence4 =
633// ::is_same < typename SEQUENCE4::sequence_tag, sequence_t > &&
634// ::is_same < typename SEQUENCE4::sequence_size, sequence_size_t < 4 > >;
635
636
637template < typename POLE >
638concept prototype_pole = requires(POLE pole)
639{
640 { pole.x }->prototype_number;
641 { pole.y }->prototype_number;
642 { pole.z }->prototype_number;
643};
644
645
646template < typename POINT >
647concept prototype_XY = requires(POINT point)
648{
649 point.X;
650 point.Y;
651};
652
653
654
655
656template < typename SIZE >
657concept function_size = requires(SIZE s)
658{
659 { s.semantic_t() } ->::std::convertible_to<size2_t>;
660 { s.x }->prototype_number;
661 { s.y }->prototype_number;
662};
663
664
665template < typename SIZE >
666concept struct_size = requires(SIZE s)
667{
668 { s.semantic_t() } ->::std::convertible_to<size2_t>;
669 { s.x }->prototype_number;
670 { s.y }->prototype_number;
671};
672
673
674
675template < typename SIZE >
676concept prototype_size = function_size <SIZE> || struct_size <SIZE>;
677
678
679template < typename Dimension >
680concept prototype_Dimension = requires(Dimension dimension)
681{
682 dimension.Width;
683 dimension.Height;
684};
685
686
687template < typename DIMENSION >
688concept prototype_dimension = requires(DIMENSION dimension)
689{
690 dimension.width;
691 dimension.height;
692};
693
694
695template<typename RECTANGLE>
696concept function_rectangle = requires(RECTANGLE rectangle) {
697 rectangle.left;
698 rectangle.top;
699 rectangle.right;
700 rectangle.bottom;
701};
702
703
704template<typename RECTANGLE>
705concept struct_rectangle = requires(RECTANGLE rectangle) {
706 { rectangle.left } -> prototype_number;
707 { rectangle.top } -> prototype_number;
708 { rectangle.right } -> prototype_number;
709 { rectangle.bottom } -> prototype_number;
710};
711
712
713template < typename RECTANGLE >
714concept prototype_rectangle =
717
718
719
720
721template < typename RECTANGLE >
722concept prototype_XYDim = requires(RECTANGLE rectangle)
723{
724 rectangle.X;
725 rectangle.Y;
726 rectangle.Width;
727 rectangle.Height;
728};
729
730template < typename RECTANGLE >
731concept struct_xydim = requires(RECTANGLE rectangle)
732{
733 rectangle.x;
734 rectangle.y;
735 rectangle.width;
736 rectangle.height;
737};
738
739template < typename RECTANGLE >
741// {
742// rectangle.x;
743// rectangle.y;
744// rectangle.width;
745// rectangle.height;
746// };
747
748
749template < typename RECTANGLE >
750concept prototype_origin_size = requires(RECTANGLE rectangle)
751{
752 { rectangle.origin }->raw_primitive_point;
753 { rectangle.size }->prototype_dimension;
754};
755
756
757//template < typename ORIGIN_SIZE >
758//concept origin_size = requires(ORIGIN_SIZE origin_size)
759//{
760//
761// { origin_size.origin } -> prototype_point;
762// { origin_size.size } -> prototype_dim;
763//
764//};
765
766
767
768template < prototype_number NUMBER >
769struct argument_of_struct < NUMBER >
770{
771
772 using type = NUMBER;
773
774};
775
776
777
778template < prototype_number NUMBER >
779class point_type;
780
781
782template < prototype_number NUMBER >
783class size_type;
784
785
786template < prototype_number NUMBER >
787class rectangle_type;
788
789
790
791template<typename SUBPARTICLE>
792concept prototype_subparticle = ::std::is_base_of_v<::subparticle, SUBPARTICLE>;
793
794
795
796//
797//
798//template < prototype_number NUMBER1, prototype_number NUMBER2 >
799//inline void copy(NUMBER1& number1, const NUMBER2& number2)
800//{
801//
802// number1 = (NUMBER1)number2;
803//
804//}
805//
806
807
808
809template < typename RAW_TYPE >
811 ::prototype_number < decay < RAW_TYPE > >
812 || ::is_same < typename decay < RAW_TYPE >::RAW_TYPE_TAG, raw_type_t >;
813
814
815template < typename RAW_TYPE >
817 ::_primitive_raw_type < RAW_TYPE >
818 || (::std::is_bounded_array_v<RAW_TYPE>
820
821
822template < typename POINTER >
824 ::is_same < typename decay <POINTER >::POINTER_TYPE_TAG, pointer_type_t >;
825
826template < typename OBJECT >
828 !::is_raw_pointer < OBJECT >
829 && !::is_function < OBJECT >
830 && !prototype_pointer2 < OBJECT >
831 && !prototype_raw_type < OBJECT >;
832
833
834template < typename PARTICLE >
835concept prototype_particle = ::std::is_base_of_v<::particle, PARTICLE>;
836
837
838template < typename T, typename TYPE >
839concept same_as = ::is_same < TYPE, erase_const_effemeral < T > >;
840
841
842template < typename T, typename TYPE >
843concept non_same_as = !::is_same < TYPE, erase_const_effemeral < T > >;
844
845
846template < typename T, typename TYPE >
847concept non_pointer_same_as = same_as < T, TYPE > && !::is_raw_pointer < T >;
848
849
850template < typename T >
851concept bool_type = same_as < T, bool >;
852
853template < typename T >
854concept i8_type = same_as < T, ::i8 >;
855
856template < typename T >
857concept char_type = same_as < T, ::i8 >;
858
859template < typename A_PARTICLE >
860concept a_particle = ::std::derived_from<A_PARTICLE, ::particle>;
861
862template < typename NON_PARTICLE >
863concept non_particle = !a_particle < NON_PARTICLE >;
864
865
866//template < typename T, typename ...Args >
867//inline T * __call_allocate(Args &&... args);
868//
869//template < typename T >
870//inline void __call__delete(T * p);
871
872
873template < prototype_character CHARACTER >
874constexpr bool string_compare_prefix(::i32 & ordering, const CHARACTER * pszA, const CHARACTER * pszB) noexcept;
875
876template < prototype_character CHARACTER >
877constexpr bool string_order_prefix(::std::strong_ordering & ordering, const CHARACTER * pszA, const CHARACTER * pszB) noexcept;
878
879
880template < prototype_fundamental TYPE >
881constexpr bool equals(TYPE a, TYPE b) { return a == b; }
882
883
884template < prototype_type TYPE >
885constexpr bool equals(const TYPE & a, const TYPE & b) { return a == b; }
886
887
888template<typename A, typename B>
889constexpr ::i32 compare(const A &a, const B &b)
890{
891 if constexpr (requires { a <=> b; })
892 {
893 auto c = a <=> b;
894
895 if (c < 0)
896 return -1;
897 if (c > 0)
898 return 1;
899
900 // covers equal OR unordered (e.g. NaN cases)
901 return 0;
902 }
903 else
904 {
905 if (a < b)
906 return -1;
907 if (b < a)
908 return 1;
909 return 0;
910 }
911}
912
913template<prototype_fundamental TYPEA, prototype_fundamental TYPEB>
914constexpr ::std::strong_ordering order(TYPEA a, TYPEB b)
915{
916 return ::std::strong_order(a, b);
917}
918
919
920
921
922template<prototype_type TYPEA, prototype_type TYPEB>
923constexpr ::std::strong_ordering order(const TYPEA & a, const TYPEB & b)
924{
925 return ::std::strong_order(a, b);
926}
927
928
929
930template<prototype_character CHARACTER, character_count m_sizeMaximumLength>
931class inline_string;
932
933
934using inline_number_string = inline_string<::i8, 64>;
935
936
937
938
939template < typename T >
940concept has_string_getter = requires(T t, ::string & str)
941{
942
943 { t.as(str) } -> std::same_as < void >;
944
945};
946
947
948
949
950template < typename CONTAINER >
951concept container_type = requires(CONTAINER container)
952{
953
954 {container.this_is_a_container()} -> std::same_as<void>;
955
956};
957
958
959template < typename ARRAY >
960concept prototype_array = requires (const ARRAY & array)
961{
962
963 array.array_range_ok();
964
965};
966
967
968template < typename LIST >
969concept prototype_list = requires(const LIST & list)
970{
971
972 list.list_base_ok();
973
974};
975
976
977template < typename MAP >
978concept prototype_map = requires(const MAP & map)
979{
980
981 map.pair_map_base_ok();
982
983};
984
985
986template < typename ARRAY >
987concept prototype_raw_type_array = requires(ARRAY array, ::collection::index i, ::collection::count c)
988{
989 array.get_count();
990 {array.element_at(i)}->prototype_raw_type;
991 array.set_size(c);
992};
993
994
995template < typename ARRAY >
996concept prototype_raw_pointer_array = requires(ARRAY array, ::collection::index i, ::collection::count c)
997{
998 array.get_count();
999 {array.element_at(i)}->prototype_raw_pointer;
1000 array.set_size(c);
1001};
1002
1003
1004template < typename ARRAY >
1005concept prototype_particle_array = requires(ARRAY array, ::collection::index i, ::collection::count c)
1006{
1007 array.get_count();
1008 {array.element_at(i)}->prototype_pointer2;
1009 array.set_size(c);
1010};
1011
1012
1013template < typename ARRAY >
1014concept prototype_object_array = requires(ARRAY array, ::collection::index i, ::collection::count c)
1015{
1016 array.get_count();
1017 {array.element_at(i)}->prototype_object;
1018 array.set_size(c);
1019};
1020
1021
1022template < typename CONTAINER >
1024 prototype_array < CONTAINER >
1025|| prototype_list < CONTAINER >
1026|| prototype_map < CONTAINER >;
1027
1028template < typename CONTAINER >
1029concept non_container = !prototype_container < CONTAINER >;
1030
1031
1032
1033template < prototype_enum ENUM >
1034inline ::i64 as_i64(const ENUM & e) { return (::i64)(::raw_enum_of<ENUM>) e; }
1035
1036
1037template<typename ITERATOR_TYPE>
1038class character_range;
1039
1040
1041template<typename ITERATOR_TYPE>
1042class const_string_range;
1043
1044
1045
1046using const_ansi_range = ::const_string_range < const ::ansi_character* >;
1047using const_wd16_range = ::const_string_range < const ::wd16_character* >;
1048using const_wd32_range = ::const_string_range < const ::wd32_character* >;
1049using const_wide_range = ::const_string_range < const ::wide_character* >;
1050
1051
1052
1053template < typename CONST_STRING_CASTABLE >
1055::std::is_convertible < CONST_STRING_CASTABLE, ::const_ansi_range >::value ||
1056::std::is_convertible < CONST_STRING_CASTABLE, ::string >::value ||
1057::std::is_convertible < CONST_STRING_CASTABLE, ::scoped_string >::value;
1058
1059
1060template < typename CONST_STRING_CASTABLE >
1062::std::is_convertible < CONST_STRING_CASTABLE, ::string >::value ||
1063::std::is_convertible < CONST_STRING_CASTABLE, ::scoped_string >::value ||
1064::std::is_convertible < CONST_STRING_CASTABLE, const_char_pointer >::value;
1065
1066
1067
1068
1069
1070template < typename NON_SUBPARTICLE >
1072
1073
1074template<typename Type, typename RawType = Type, ::enum_type t_etypeContainer = e_type_element >
1075class string_base_array;
1076
1077
1078using string_array_base = string_base_array < string, string, e_type_string_array >;
1079using wstring_array_base = string_base_array < wstring, wstring >;
1080
1081
1082using string_array = ::comparable_array_particle < string_array_base >;
1083using wstring_array = ::comparable_array_particle < wstring_array_base >;
1084
1085
1086template < typename POINTER_BUT_NO_INTEGRAL, typename TYPE >
1087concept pointer_but_not_integral = ::std::convertible_to < POINTER_BUT_NO_INTEGRAL, TYPE * > && !prototype_integral < POINTER_BUT_NO_INTEGRAL >;
1088
1089
1090template <class>
1091constexpr bool is_lvalue_reference = false; // determine whether type argument is an lvalue reference
1092
1093template <class _Ty>
1094constexpr bool is_lvalue_reference<_Ty&> = true;
1095
1096
1097template <class _Ty>
1098constexpr _Ty&& land(_Ty&& t, non_reference < _Ty>& _Arg) noexcept {
1099 return t = static_cast<_Ty&&>(_Arg);
1100}
1101
1102template <class _Ty>
1103constexpr _Ty&& land(_Ty&& t, non_reference < _Ty>&& _Arg) noexcept
1104{
1105 static_assert(!is_lvalue_reference<_Ty>, "bad argument");
1106 return t = static_cast<_Ty&&>(_Arg);
1107}
1108
1109template < typename T >
1110concept generic_range = requires(const T & t)
1111{
1112
1113 t.begin();
1114 t.end();
1115
1116};
1117
1118
1119//template < typename T >
1120//concept container_range =
1121//::std::is_base_of_v < ::range< typename T::this_iterator >, T >
1122//&& !::std::is_base_of_v < ::character_range< typename T::this_iterator >, T >;
1123
1124
1125
1126template < typename T >
1128generic_range < T >
1129&& !::std::is_base_of_v < ::character_range< typename T::this_iterator >, T >;
1130
Definition character_range.h:77
Definition _template_after_initial_concepts.h:15
Definition inline_string.h:12
Definition point.h:12
Definition range.h:223
Definition rectangle.h:49
Definition scoped_string_base.h:13
Definition size.h:11
Definition string_array.h:47
Definition string_base.h:90
Definition tuple.h:72
Definition aaa_want_to_remove_str_wstring.h:94
Definition _initial_concepts.h:810
Definition _initial_concepts.h:860
Definition _initial_concepts.h:247
Definition _initial_concepts.h:851
Definition _initial_concepts.h:142
Definition _initial_concepts.h:857
Definition _initial_concepts.h:306
Definition _initial_concepts.h:574
Definition _initial_concepts.h:570
Definition _initial_concepts.h:408
Definition _initial_concepts.h:405
Definition _initial_concepts.h:244
Definition _initial_concepts.h:241
Definition _initial_concepts.h:178
Definition _initial_concepts.h:1061
Definition _initial_concepts.h:1054
Definition _initial_concepts.h:1127
Definition _initial_concepts.h:951
Definition _initial_concepts.h:599
Definition _initial_concepts.h:696
Definition _initial_concepts.h:657
Definition _initial_concepts.h:1110
Definition _initial_concepts.h:541
Definition _initial_concepts.h:462
Definition _initial_concepts.h:470
Definition _initial_concepts.h:940
Definition _initial_concepts.h:854
Definition _initial_concepts.h:147
Definition _initial_concepts.h:1029
Definition _initial_concepts.h:863
Definition _initial_concepts.h:847
Definition _initial_concepts.h:1071
Definition _initial_concepts.h:165
Definition _initial_concepts.h:843
Definition _initial_concepts.h:320
Definition _initial_concepts.h:383
Definition _initial_concepts.h:294
Definition _initial_concepts.h:300
Definition _initial_concepts.h:558
Definition _initial_concepts.h:1087
Definition _initial_concepts.h:151
Definition _initial_concepts.h:156
Definition _aaa_other_initial_concepts.h:61
Definition _aaa_other_initial_concepts.h:87
Definition _aaa_other_initial_concepts.h:45
Definition _initial_concepts.h:111
Definition _initial_concepts.h:960
Definition _initial_concepts.h:545
Definition _initial_concepts.h:71
Definition _initial_concepts.h:61
Definition _initial_concepts.h:271
Definition _initial_concepts.h:253
Definition _initial_concepts.h:349
Definition _initial_concepts.h:367
Definition _initial_concepts.h:169
Definition _initial_concepts.h:535
Definition _initial_concepts.h:1023
Definition _aaa_other_initial_concepts.h:69
Definition _initial_concepts.h:64
Definition _initial_concepts.h:57
Definition _initial_concepts.h:106
Definition _initial_concepts.h:115
Definition _initial_concepts.h:88
Definition _initial_concepts.h:578
Definition _initial_concepts.h:84
Definition enumeration.h:9
Definition _initial_concepts.h:393
Definition _initial_concepts.h:969
Definition _initial_concepts.h:978
Definition _initial_concepts.h:91
Definition _initial_concepts.h:538
Definition _aaa_other_initial_concepts.h:13
Definition _initial_concepts.h:1014
Definition _initial_concepts.h:827
Definition _aaa_other_initial_concepts.h:107
Definition _initial_concepts.h:1005
Definition _initial_concepts.h:835
Definition _initial_concepts.h:529
Definition _aaa_other_initial_concepts.h:28
Definition _initial_concepts.h:823
Definition _aaa_other_initial_concepts.h:36
Definition _initial_concepts.h:124
Definition _initial_concepts.h:74
Definition _initial_concepts.h:53
Definition _initial_concepts.h:996
Definition _initial_concepts.h:987
Definition _initial_concepts.h:816
Definition _aaa_other_initial_concepts.h:77
Definition _initial_concepts.h:565
Definition _initial_concepts.h:31
Definition _initial_concepts.h:38
Definition _initial_concepts.h:44
Definition _initial_concepts.h:28
Definition _initial_concepts.h:97
Definition _initial_concepts.h:94
Definition _aaa_other_initial_concepts.h:53
Definition _initial_concepts.h:363
Definition _initial_concepts.h:548
Definition _initial_concepts.h:792
Definition _initial_concepts.h:118
Definition _initial_concepts.h:103
Definition _initial_concepts.h:100
Definition _aaa_other_initial_concepts.h:97
Definition _initial_concepts.h:160
Definition _aaa_other_initial_concepts.h:20
Definition _initial_concepts.h:839
Definition _initial_concepts.h:127
Definition _initial_concepts.h:607
Definition _initial_concepts.h:705
Definition _initial_concepts.h:666
Definition _initial_concepts.h:731
Definition _initial_concepts.h:313
Definition _initial_concepts.h:376
Definition _initial_concepts.h:289
Definition _initial_concepts.h:551
Definition _initial_concepts.h:136
Definition _initial_concepts.h:390
Definition _forward_declaration.h:2520
Definition _initial_concepts.h:397
Definition _initial_concepts.h:203
Definition _initial_concepts.h:185
Definition _initial_concepts.h:220
Definition _initial_concepts.h:14
Definition _initial_concepts.h:12
Definition _structures.h:21
Definition _structures.h:24
Definition _initial_concepts.h:13