@@ -729,14 +729,14 @@ namespace meta {
729
729
) ->
730
730
std::unique_ptr<statement_node>
731
731
{
732
- CPP2_UFCS (&,,(push_back),(generated_lines),(, ), std::vector<source_line>());
732
+ CPP2_UFCS (&,,(push_back),(generated_lines),(), std::vector<source_line>());
733
733
auto lines {&CPP2_UFCS (&,,(back),(generated_lines),())};
734
734
735
735
auto add_line {[&, _1 = lines](cpp2::in<std::string_view> s) -> void {
736
- (void ) CPP2_UFCS (&,,(emplace_back),((*cpp2::assert_not_null (_1))),(, ), s, source_line::category::cpp2);
736
+ (void ) CPP2_UFCS (&,,(emplace_back),((*cpp2::assert_not_null (_1))),(), s, source_line::category::cpp2);
737
737
}};
738
738
{
739
- auto newline_pos = CPP2_UFCS (&,,(find),(source),(, ), ' \n ' );
739
+ auto newline_pos = CPP2_UFCS (&,,(find),(source),(), ' \n ' );
740
740
741
741
// First split this string into source_lines
742
742
//
@@ -747,9 +747,9 @@ auto newline_pos = CPP2_UFCS(&,,(find),(source),(,), '\n');
747
747
{
748
748
while ( newline_pos!=std::string_view::npos )
749
749
{
750
- add_line (CPP2_UFCS (&,,(substr),(source),(, ), 0 , newline_pos));
751
- CPP2_UFCS (&,,(remove_prefix),(source),(, ), newline_pos + 1 );
752
- newline_pos = CPP2_UFCS (&,,(find),(source),(, ), ' \n ' );
750
+ add_line (CPP2_UFCS (&,,(substr),(source),(), 0 , newline_pos));
751
+ CPP2_UFCS (&,,(remove_prefix),(source),(), newline_pos + 1 );
752
+ newline_pos = CPP2_UFCS (&,,(find),(source),(), ' \n ' );
753
753
}
754
754
}
755
755
}
@@ -762,15 +762,15 @@ auto newline_pos = CPP2_UFCS(&,,(find),(source),(,), '\n');
762
762
// Now lex this source fragment to generate
763
763
// a single grammar_map entry, whose .second
764
764
// is the vector of tokens
765
- (void ) CPP2_UFCS (&,,(emplace_back),(generated_lexers),(, ), *cpp2::assert_not_null (errors));
765
+ (void ) CPP2_UFCS (&,,(emplace_back),(generated_lexers),(), *cpp2::assert_not_null (errors));
766
766
auto tokens {&CPP2_UFCS (&,,(back),(generated_lexers),())};
767
- CPP2_UFCS (&,,(lex),((*cpp2::assert_not_null (tokens))),(, ), *cpp2::assert_not_null (std::move (lines)), true );
767
+ CPP2_UFCS (&,,(lex),((*cpp2::assert_not_null (tokens))),(), *cpp2::assert_not_null (std::move (lines)), true );
768
768
769
769
cpp2::Default.expects (std::ssize (CPP2_UFCS (&,,(get_map),((*cpp2::assert_not_null (tokens))),()))==1 , " " );
770
770
771
771
// Now parse this single declaration from
772
772
// the lexed tokens
773
- return CPP2_UFCS (&,,(parse_one_declaration),(parser),(, ),
773
+ return CPP2_UFCS (&,,(parse_one_declaration),(parser),(),
774
774
(*cpp2::assert_not_null (CPP2_UFCS (&,,(begin),(CPP2_UFCS (&,,(get_map),(*cpp2::assert_not_null (std::move (tokens))),())),()))).second ,
775
775
*cpp2::assert_not_null (generated_tokens)
776
776
);
@@ -799,7 +799,7 @@ auto newline_pos = CPP2_UFCS(&,,(find),(source),(,), '\n');
799
799
if (!(CPP2_UFCS (&,,(empty),(meta_function_name),()))) {
800
800
message = " while applying @" + meta_function_name + " - " + message;
801
801
}
802
- (void ) CPP2_UFCS (&,,(emplace_back),((*cpp2::assert_not_null (errors))),(, ), position (), std::move (message));
802
+ (void ) CPP2_UFCS (&,,(emplace_back),((*cpp2::assert_not_null (errors))),(), position (), std::move (message));
803
803
}
804
804
805
805
compiler_services::~compiler_services () noexcept {}
@@ -858,7 +858,7 @@ declaration_base::declaration_base(declaration_base const& that)
858
858
[[nodiscard]] auto declaration::make_private () -> bool { return CPP2_UFCS (&,,(make_private),((*cpp2::assert_not_null (n))),()); }
859
859
860
860
[[nodiscard]] auto declaration::has_name () const -> bool { return CPP2_UFCS (&,,(has_name),((*cpp2::assert_not_null (n))),()); }
861
- [[nodiscard]] auto declaration::has_name (cpp2::in<std::string_view> s) const -> bool { return CPP2_UFCS (&,,(has_name),((*cpp2::assert_not_null (n))),(, ), s); }
861
+ [[nodiscard]] auto declaration::has_name (cpp2::in<std::string_view> s) const -> bool { return CPP2_UFCS (&,,(has_name),((*cpp2::assert_not_null (n))),(), s); }
862
862
863
863
[[nodiscard]] auto declaration::name () const -> std::string_view{
864
864
if (has_name ()) {return CPP2_UFCS (&,,(as_string_view),((*cpp2::assert_not_null (CPP2_UFCS (&,,(name),(*cpp2::assert_not_null (n)),())))),()); }
@@ -906,14 +906,14 @@ declaration::declaration(declaration const& that)
906
906
cpp2::Default.expects (CPP2_UFCS (&,,(is_function),((*cpp2::assert_not_null (n))),()), " " );
907
907
}
908
908
909
- [[nodiscard]] auto function_declaration::index_of_parameter_named (cpp2::in<std::string_view> s) const -> int { return CPP2_UFCS (&,,(index_of_parameter_named),((*cpp2::assert_not_null (n))),(, ), s); }
910
- [[nodiscard]] auto function_declaration::has_parameter_named (cpp2::in<std::string_view> s) const -> bool { return CPP2_UFCS (&,,(has_parameter_named),((*cpp2::assert_not_null (n))),(, ), s); }
911
- [[nodiscard]] auto function_declaration::has_in_parameter_named (cpp2::in<std::string_view> s) const -> bool { return CPP2_UFCS (&,,(has_in_parameter_named),((*cpp2::assert_not_null (n))),(, ), s); }
912
- [[nodiscard]] auto function_declaration::has_out_parameter_named (cpp2::in<std::string_view> s) const -> bool { return CPP2_UFCS (&,,(has_out_parameter_named),((*cpp2::assert_not_null (n))),(, ), s); }
913
- [[nodiscard]] auto function_declaration::has_move_parameter_named (cpp2::in<std::string_view> s) const -> bool { return CPP2_UFCS (&,,(has_move_parameter_named),((*cpp2::assert_not_null (n))),(, ), s); }
909
+ [[nodiscard]] auto function_declaration::index_of_parameter_named (cpp2::in<std::string_view> s) const -> int { return CPP2_UFCS (&,,(index_of_parameter_named),((*cpp2::assert_not_null (n))),(), s); }
910
+ [[nodiscard]] auto function_declaration::has_parameter_named (cpp2::in<std::string_view> s) const -> bool { return CPP2_UFCS (&,,(has_parameter_named),((*cpp2::assert_not_null (n))),(), s); }
911
+ [[nodiscard]] auto function_declaration::has_in_parameter_named (cpp2::in<std::string_view> s) const -> bool { return CPP2_UFCS (&,,(has_in_parameter_named),((*cpp2::assert_not_null (n))),(), s); }
912
+ [[nodiscard]] auto function_declaration::has_out_parameter_named (cpp2::in<std::string_view> s) const -> bool { return CPP2_UFCS (&,,(has_out_parameter_named),((*cpp2::assert_not_null (n))),(), s); }
913
+ [[nodiscard]] auto function_declaration::has_move_parameter_named (cpp2::in<std::string_view> s) const -> bool { return CPP2_UFCS (&,,(has_move_parameter_named),((*cpp2::assert_not_null (n))),(), s); }
914
914
915
915
[[nodiscard]] auto function_declaration::has_parameter_with_name_and_pass (cpp2::in<std::string_view> s, cpp2::in<passing_style> pass) const -> bool {
916
- return CPP2_UFCS (&,,(has_parameter_with_name_and_pass),((*cpp2::assert_not_null (n))),(, ), s, pass); }
916
+ return CPP2_UFCS (&,,(has_parameter_with_name_and_pass),((*cpp2::assert_not_null (n))),(), s, pass); }
917
917
[[nodiscard]] auto function_declaration::is_function_with_this () const -> bool { return CPP2_UFCS (&,,(is_function_with_this),((*cpp2::assert_not_null (n))),()); }
918
918
[[nodiscard]] auto function_declaration::is_virtual () const -> bool { return CPP2_UFCS (&,,(is_virtual_function),((*cpp2::assert_not_null (n))),()); }
919
919
[[nodiscard]] auto function_declaration::is_defaultable () const -> bool { return CPP2_UFCS (&,,(is_defaultable_function),((*cpp2::assert_not_null (n))),()); }
@@ -1001,8 +1001,8 @@ declaration::declaration(declaration const& that)
1001
1001
std::vector<function_declaration>
1002
1002
{
1003
1003
std::vector<function_declaration> ret {};
1004
- for ( auto const & d : CPP2_UFCS (&,,(get_type_scope_declarations),((*cpp2::assert_not_null (n))),(, ), declaration_node::functions) ) {
1005
- (void ) CPP2_UFCS (&,,(emplace_back),(ret),(, ), d, (*this ));
1004
+ for ( auto const & d : CPP2_UFCS (&,,(get_type_scope_declarations),((*cpp2::assert_not_null (n))),(), declaration_node::functions) ) {
1005
+ (void ) CPP2_UFCS (&,,(emplace_back),(ret),(), d, (*this ));
1006
1006
}
1007
1007
return ret;
1008
1008
}
@@ -1011,8 +1011,8 @@ declaration::declaration(declaration const& that)
1011
1011
std::vector<object_declaration>
1012
1012
{
1013
1013
std::vector<object_declaration> ret {};
1014
- for ( auto const & d : CPP2_UFCS (&,,(get_type_scope_declarations),((*cpp2::assert_not_null (n))),(, ), declaration_node::objects) ) {
1015
- (void ) CPP2_UFCS (&,,(emplace_back),(ret),(, ), d, (*this ));
1014
+ for ( auto const & d : CPP2_UFCS (&,,(get_type_scope_declarations),((*cpp2::assert_not_null (n))),(), declaration_node::objects) ) {
1015
+ (void ) CPP2_UFCS (&,,(emplace_back),(ret),(), d, (*this ));
1016
1016
}
1017
1017
return ret;
1018
1018
}
@@ -1021,8 +1021,8 @@ declaration::declaration(declaration const& that)
1021
1021
std::vector<type_declaration>
1022
1022
{
1023
1023
std::vector<type_declaration> ret {};
1024
- for ( auto const & d : CPP2_UFCS (&,,(get_type_scope_declarations),((*cpp2::assert_not_null (n))),(, ), declaration_node::types) ) {
1025
- (void ) CPP2_UFCS (&,,(emplace_back),(ret),(, ), d, (*this ));
1024
+ for ( auto const & d : CPP2_UFCS (&,,(get_type_scope_declarations),((*cpp2::assert_not_null (n))),(), declaration_node::types) ) {
1025
+ (void ) CPP2_UFCS (&,,(emplace_back),(ret),(), d, (*this ));
1026
1026
}
1027
1027
return ret;
1028
1028
}
@@ -1031,8 +1031,8 @@ declaration::declaration(declaration const& that)
1031
1031
std::vector<declaration>
1032
1032
{
1033
1033
std::vector<declaration> ret {};
1034
- for ( auto const & d : CPP2_UFCS (&,,(get_type_scope_declarations),((*cpp2::assert_not_null (n))),(, ), declaration_node::all) ) {
1035
- (void ) CPP2_UFCS (&,,(emplace_back),(ret),(, ), d, (*this ));
1034
+ for ( auto const & d : CPP2_UFCS (&,,(get_type_scope_declarations),((*cpp2::assert_not_null (n))),(), declaration_node::all) ) {
1035
+ (void ) CPP2_UFCS (&,,(emplace_back),(ret),(), d, (*this ));
1036
1036
}
1037
1037
return ret;
1038
1038
}
@@ -1058,7 +1058,7 @@ declaration::declaration(declaration const& that)
1058
1058
{
1059
1059
auto decl {parse_statement (source)};
1060
1060
if (decl) {
1061
- return CPP2_UFCS (&,,(add_type_member),((*cpp2::assert_not_null (n))),(, ), std::move (decl));
1061
+ return CPP2_UFCS (&,,(add_type_member),((*cpp2::assert_not_null (n))),(), std::move (decl));
1062
1062
}
1063
1063
return false ;
1064
1064
}
@@ -1073,7 +1073,7 @@ declaration::declaration(declaration const& that)
1073
1073
#line 458 "reflect.h2"
1074
1074
auto add_virtual_destructor (meta::type_declaration& t) -> void
1075
1075
{
1076
- CPP2_UFCS (&,,(require),(t),(, ), CPP2_UFCS (&,,(add_member),(t),(, ), " operator=: (virtual move this) = { }" ),
1076
+ CPP2_UFCS (&,,(require),(t),(), CPP2_UFCS (&,,(add_member),(t),(), " operator=: (virtual move this) = { }" ),
1077
1077
" could not add virtual destructor" );
1078
1078
}
1079
1079
@@ -1084,15 +1084,15 @@ auto interface(meta::type_declaration& t) -> void
1084
1084
1085
1085
for ( auto & m : CPP2_UFCS (&,,(get_members),(t),()) )
1086
1086
{
1087
- CPP2_UFCS (&,,(require),(m),(, ), !(CPP2_UFCS (&,,(is_object),(m),())),
1087
+ CPP2_UFCS (&,,(require),(m),(), !(CPP2_UFCS (&,,(is_object),(m),())),
1088
1088
" interfaces may not contain data objects" );
1089
1089
if (CPP2_UFCS (&,,(is_function),(m),())) {
1090
1090
auto mf {CPP2_UFCS (&,,(as_function),(m),())};
1091
- CPP2_UFCS (&,,(require),(mf),(, ), !(CPP2_UFCS (&,,(is_copy_or_move),(mf),())),
1091
+ CPP2_UFCS (&,,(require),(mf),(), !(CPP2_UFCS (&,,(is_copy_or_move),(mf),())),
1092
1092
" interfaces may not copy or move; consider a virtual clone() instead" );
1093
- CPP2_UFCS (&,,(require),(mf),(, ), !(CPP2_UFCS (&,,(has_initializer),(mf),())),
1093
+ CPP2_UFCS (&,,(require),(mf),(), !(CPP2_UFCS (&,,(has_initializer),(mf),())),
1094
1094
" interface functions must not have a function body; remove the '=' initializer" );
1095
- CPP2_UFCS (&,,(require),(mf),(, ), CPP2_UFCS (&,,(make_public),(mf),()),
1095
+ CPP2_UFCS (&,,(require),(mf),(), CPP2_UFCS (&,,(make_public),(mf),()),
1096
1096
" interface functions must be public" );
1097
1097
CPP2_UFCS (&,,(default_to_virtual),(mf),());
1098
1098
has_dtor |= CPP2_UFCS (&,,(is_destructor),(mf),());
@@ -1114,11 +1114,11 @@ auto polymorphic_base(meta::type_declaration& t) -> void
1114
1114
if (CPP2_UFCS (&,,(is_default_access),(mf),())) {
1115
1115
CPP2_UFCS (&,,(default_to_public),(mf),());
1116
1116
}
1117
- CPP2_UFCS (&,,(require),(mf),(, ), !(CPP2_UFCS (&,,(is_copy_or_move),(mf),())),
1117
+ CPP2_UFCS (&,,(require),(mf),(), !(CPP2_UFCS (&,,(is_copy_or_move),(mf),())),
1118
1118
" polymorphic base types may not copy or move; consider a virtual clone() instead" );
1119
1119
if (CPP2_UFCS (&,,(is_destructor),(mf),())) {
1120
1120
has_dtor = true ;
1121
- CPP2_UFCS (&,,(require),(mf),(, ), (CPP2_UFCS (&,,(is_public),(mf),()) && CPP2_UFCS (&,,(is_virtual),(mf),()))
1121
+ CPP2_UFCS (&,,(require),(mf),(), (CPP2_UFCS (&,,(is_public),(mf),()) && CPP2_UFCS (&,,(is_virtual),(mf),()))
1122
1122
|| (CPP2_UFCS (&,,(is_protected),(mf),()) && !(CPP2_UFCS (&,,(is_virtual),(mf),()))),
1123
1123
" a polymorphic base type destructor must be public and virtual, or protected and nonvirtual" );
1124
1124
}
@@ -1139,18 +1139,18 @@ auto ordered_impl(
1139
1139
1140
1140
for ( auto & mf : CPP2_UFCS (&,,(get_member_functions),(t),()) )
1141
1141
{
1142
- if (CPP2_UFCS (&,,(has_name),(mf),(, ), " operator<=>" )) {
1142
+ if (CPP2_UFCS (&,,(has_name),(mf),(), " operator<=>" )) {
1143
1143
has_spaceship = true ;
1144
1144
auto return_name {CPP2_UFCS (&,,(unnamed_return_type),(mf),())};
1145
- if (CPP2_UFCS (&,,(find),(return_name),(, ), ordering)==return_name.npos )
1145
+ if (CPP2_UFCS (&,,(find),(return_name),(), ordering)==return_name.npos )
1146
1146
{
1147
- CPP2_UFCS (&,,(error),(mf),(, ), " operator<=> must return std::" + cpp2::as_<std::string>(ordering));
1147
+ CPP2_UFCS (&,,(error),(mf),(), " operator<=> must return std::" + cpp2::as_<std::string>(ordering));
1148
1148
}
1149
1149
}
1150
1150
}
1151
1151
1152
1152
if (!(std::move (has_spaceship))) {
1153
- CPP2_UFCS (&,,(require),(t),(, ), CPP2_UFCS (&,,(add_member),(t),(, ), " operator<=>: (this, that) -> std::" + (cpp2::as_<std::string>(ordering)) + " ;" ),
1153
+ CPP2_UFCS (&,,(require),(t),(), CPP2_UFCS (&,,(add_member),(t),(), " operator<=>: (this, that) -> std::" + (cpp2::as_<std::string>(ordering)) + " ;" ),
1154
1154
" could not add operator<=> with std::" + (cpp2::as_<std::string>(ordering)));
1155
1155
}
1156
1156
}
@@ -1188,10 +1188,10 @@ auto copyable(meta::type_declaration& t) -> void
1188
1188
|| smfs.inout_this_move_that ))
1189
1189
1190
1190
{
1191
- CPP2_UFCS (&,,(error),(t),(, ), " this type is partially copyable/movable - when you provide any of the more-specific operator= signatures, you must also provide the one with the general signature (out this, that); alternatively, consider removing all the operator= functions and let them all be generated for you with default memberwise semantics" );
1191
+ CPP2_UFCS (&,,(error),(t),(), " this type is partially copyable/movable - when you provide any of the more-specific operator= signatures, you must also provide the one with the general signature (out this, that); alternatively, consider removing all the operator= functions and let them all be generated for you with default memberwise semantics" );
1192
1192
}
1193
1193
else {if (!(std::move (smfs).out_this_in_that )) {
1194
- CPP2_UFCS (&,,(require),(t),(, ), CPP2_UFCS (&,,(add_member),(t),(, ), " operator=: (out this, that) = { }" ),
1194
+ CPP2_UFCS (&,,(require),(t),(), CPP2_UFCS (&,,(add_member),(t),(), " operator=: (out this, that) = { }" ),
1195
1195
" could not add general operator=:(out this, that)" );
1196
1196
}}
1197
1197
}
@@ -1204,14 +1204,14 @@ auto basic_value(meta::type_declaration& t) -> void
1204
1204
auto has_default_ctor {false };
1205
1205
for ( auto & mf : CPP2_UFCS (&,,(get_member_functions),(t),()) ) {
1206
1206
has_default_ctor |= CPP2_UFCS (&,,(is_default_constructor),(mf),());
1207
- CPP2_UFCS (&,,(require),(mf),(, ), !(CPP2_UFCS (&,,(is_protected),(mf),())) && !(CPP2_UFCS (&,,(is_virtual),(mf),())),
1207
+ CPP2_UFCS (&,,(require),(mf),(), !(CPP2_UFCS (&,,(is_protected),(mf),())) && !(CPP2_UFCS (&,,(is_virtual),(mf),())),
1208
1208
" a value type may not have a protected or virtual function" );
1209
- CPP2_UFCS (&,,(require),(mf),(, ), !(CPP2_UFCS (&,,(is_destructor),(mf),())) || CPP2_UFCS (&,,(is_public),(mf),()),
1209
+ CPP2_UFCS (&,,(require),(mf),(), !(CPP2_UFCS (&,,(is_destructor),(mf),())) || CPP2_UFCS (&,,(is_public),(mf),()),
1210
1210
" a value type may not have a non-public destructor" );
1211
1211
}
1212
1212
1213
1213
if (!(std::move (has_default_ctor))) {
1214
- CPP2_UFCS (&,,(require),(t),(, ), CPP2_UFCS (&,,(add_member),(t),(, ), " operator=: (out this) = { }" ),
1214
+ CPP2_UFCS (&,,(require),(t),(), CPP2_UFCS (&,,(add_member),(t),(), " operator=: (out this) = { }" ),
1215
1215
" could not add default constructor" );
1216
1216
}
1217
1217
}
@@ -1240,13 +1240,13 @@ auto cpp2_struct(meta::type_declaration& t) -> void
1240
1240
{
1241
1241
for ( auto & m : CPP2_UFCS (&,,(get_members),(t),()) )
1242
1242
{
1243
- CPP2_UFCS (&,,(require),(m),(, ), CPP2_UFCS (&,,(make_public),(m),()),
1243
+ CPP2_UFCS (&,,(require),(m),(), CPP2_UFCS (&,,(make_public),(m),()),
1244
1244
" all struct members must be public" );
1245
1245
if (CPP2_UFCS (&,,(is_function),(m),())) {
1246
1246
auto mf {CPP2_UFCS (&,,(as_function),(m),())};
1247
- CPP2_UFCS (&,,(require),(t),(, ), !(CPP2_UFCS (&,,(is_virtual),(mf),())),
1247
+ CPP2_UFCS (&,,(require),(t),(), !(CPP2_UFCS (&,,(is_virtual),(mf),())),
1248
1248
" a struct may not have a virtual function" );
1249
- CPP2_UFCS (&,,(require),(t),(, ), !(CPP2_UFCS (&,,(has_name),(mf),(, ), " operator=" )),
1249
+ CPP2_UFCS (&,,(require),(t),(), !(CPP2_UFCS (&,,(has_name),(mf),(), " operator=" )),
1250
1250
" a struct may not have a user-defined operator=" );
1251
1251
}
1252
1252
}
0 commit comments