@@ -182,7 +182,7 @@ namespace meta {
182
182
// -----------------------------------------------------------------------
183
183
//
184
184
185
- // All declarations are noncopyable wrappers around a pointer to node
185
+ // All declarations are wrappers around a pointer to node
186
186
//
187
187
class declaration_base
188
188
: public compiler_services {
@@ -808,43 +808,39 @@ declaration::declaration(declaration const& that)
808
808
std::vector<function_declaration>
809
809
{
810
810
std::vector<function_declaration> ret {};
811
- { auto const & cpp2_range = CPP2_UFCS (get_type_scope_declarations, (*cpp2::assert_not_null (n)), declaration_node::functions); for ( auto const & d : cpp2_range ) {
811
+ for ( auto const & d : CPP2_UFCS (get_type_scope_declarations, (*cpp2::assert_not_null (n)), declaration_node::functions) ) {
812
812
CPP2_UFCS (emplace_back, ret, d, (*this ));
813
- }}
814
- #line 332 "reflect.h2"
813
+ }
815
814
return ret;
816
815
}
817
816
818
817
[[nodiscard]] auto type_declaration::get_member_objects () const ->
819
818
std::vector<object_declaration>
820
819
{
821
820
std::vector<object_declaration> ret {};
822
- { auto const & cpp2_range = CPP2_UFCS (get_type_scope_declarations, (*cpp2::assert_not_null (n)), declaration_node::objects); for ( auto const & d : cpp2_range ) {
821
+ for ( auto const & d : CPP2_UFCS (get_type_scope_declarations, (*cpp2::assert_not_null (n)), declaration_node::objects) ) {
823
822
CPP2_UFCS (emplace_back, ret, d, (*this ));
824
- }}
825
- #line 342 "reflect.h2"
823
+ }
826
824
return ret;
827
825
}
828
826
829
827
[[nodiscard]] auto type_declaration::get_member_types () const ->
830
828
std::vector<type_declaration>
831
829
{
832
830
std::vector<type_declaration> ret {};
833
- { auto const & cpp2_range = CPP2_UFCS (get_type_scope_declarations, (*cpp2::assert_not_null (n)), declaration_node::types); for ( auto const & d : cpp2_range ) {
831
+ for ( auto const & d : CPP2_UFCS (get_type_scope_declarations, (*cpp2::assert_not_null (n)), declaration_node::types) ) {
834
832
CPP2_UFCS (emplace_back, ret, d, (*this ));
835
- }}
836
- #line 352 "reflect.h2"
833
+ }
837
834
return ret;
838
835
}
839
836
840
837
[[nodiscard]] auto type_declaration::get_members () const ->
841
838
std::vector<declaration>
842
839
{
843
840
std::vector<declaration> ret {};
844
- { auto const & cpp2_range = CPP2_UFCS (get_type_scope_declarations, (*cpp2::assert_not_null (n)), declaration_node::all); for ( auto const & d : cpp2_range ) {
841
+ for ( auto const & d : CPP2_UFCS (get_type_scope_declarations, (*cpp2::assert_not_null (n)), declaration_node::all) ) {
845
842
CPP2_UFCS (emplace_back, ret, d, (*this ));
846
- }}
847
- #line 362 "reflect.h2"
843
+ }
848
844
return ret;
849
845
}
850
846
@@ -889,7 +885,7 @@ auto interface(meta::type_declaration& t) -> void
889
885
{
890
886
auto has_dtor {false };
891
887
892
- { auto && cpp2_range = CPP2_UFCS_0 (get_members, t); for ( auto & m : cpp2_range )
888
+ for ( auto & m : CPP2_UFCS_0 (get_members, t) )
893
889
{
894
890
CPP2_UFCS (require, m, !(CPP2_UFCS_0 (is_object, m)),
895
891
" interfaces may not contain data objects" );
@@ -904,9 +900,8 @@ auto interface(meta::type_declaration& t) -> void
904
900
CPP2_UFCS_0 (make_virtual, mf);
905
901
has_dtor |= CPP2_UFCS_0 (is_destructor, mf);
906
902
}
907
- }}
903
+ }
908
904
909
- #line 444 "reflect.h2"
910
905
if (!(std::move (has_dtor))) {
911
906
add_virtual_destructor (t);
912
907
}
@@ -917,7 +912,7 @@ auto polymorphic_base(meta::type_declaration& t) -> void
917
912
{
918
913
auto has_dtor {false };
919
914
920
- { auto && cpp2_range = CPP2_UFCS_0 (get_member_functions, t); for ( auto & mf : cpp2_range )
915
+ for ( auto & mf : CPP2_UFCS_0 (get_member_functions, t) )
921
916
{
922
917
if (CPP2_UFCS_0 (is_default_access, mf)) {
923
918
CPP2_UFCS_0 (make_public, mf);
@@ -930,9 +925,8 @@ auto polymorphic_base(meta::type_declaration& t) -> void
930
925
|| (CPP2_UFCS_0 (is_protected, mf) && !(CPP2_UFCS_0 (is_virtual, mf))),
931
926
" a polymorphic base type destructor must be public and virtual, or protected and nonvirtual" );
932
927
}
933
- }}
928
+ }
934
929
935
- #line 488 "reflect.h2"
936
930
if (!(std::move (has_dtor))) {
937
931
add_virtual_destructor (t);
938
932
}
@@ -946,7 +940,7 @@ auto ordered_impl(
946
940
{
947
941
auto has_spaceship {false };
948
942
949
- { auto && cpp2_range = CPP2_UFCS_0 (get_member_functions, t); for ( auto & mf : cpp2_range )
943
+ for ( auto & mf : CPP2_UFCS_0 (get_member_functions, t) )
950
944
{
951
945
if (CPP2_UFCS (has_name, mf, " operator<=>" )) {
952
946
has_spaceship = true ;
@@ -956,9 +950,8 @@ auto ordered_impl(
956
950
CPP2_UFCS (error, mf, " operator<=> must return std::" + cpp2::as_<std::string>(ordering));
957
951
}
958
952
}
959
- }}
953
+ }
960
954
961
- #line 533 "reflect.h2"
962
955
if (!(std::move (has_spaceship))) {
963
956
CPP2_UFCS (require, t, CPP2_UFCS (add_member, t, " operator<=>: (this, that) -> std::" + (cpp2::as_<std::string>(ordering)) + " ;" ),
964
957
" could not add operator<=> with std::" + (cpp2::as_<std::string>(ordering)));
@@ -1012,15 +1005,14 @@ auto basic_value(meta::type_declaration& t) -> void
1012
1005
copyable (t);
1013
1006
1014
1007
auto has_default_ctor {false };
1015
- { auto && cpp2_range = CPP2_UFCS_0 (get_member_functions, t); for ( auto & mf : cpp2_range ) {
1008
+ for ( auto & mf : CPP2_UFCS_0 (get_member_functions, t) ) {
1016
1009
has_default_ctor |= CPP2_UFCS_0 (is_default_constructor, mf);
1017
1010
CPP2_UFCS (require, mf, !(CPP2_UFCS_0 (is_protected, mf)) && !(CPP2_UFCS_0 (is_virtual, mf)),
1018
1011
" a value type may not have a protected or virtual function" );
1019
1012
CPP2_UFCS (require, mf, !(CPP2_UFCS_0 (is_destructor, mf)) || CPP2_UFCS_0 (is_public, mf),
1020
1013
" a value type may not have a non-public destructor" );
1021
- }}
1014
+ }
1022
1015
1023
- #line 624 "reflect.h2"
1024
1016
if (!(std::move (has_default_ctor))) {
1025
1017
CPP2_UFCS (require, t, CPP2_UFCS (add_member, t, " operator=: (out this) = { }" ),
1026
1018
" could not add default constructor" );
@@ -1049,7 +1041,7 @@ auto partially_ordered_value(meta::type_declaration& t) -> void
1049
1041
#line 683 "reflect.h2"
1050
1042
auto cpp2_struct (meta::type_declaration& t) -> void
1051
1043
{
1052
- { auto && cpp2_range = CPP2_UFCS_0 (get_members, t); for ( auto & m : cpp2_range )
1044
+ for ( auto & m : CPP2_UFCS_0 (get_members, t) )
1053
1045
{
1054
1046
CPP2_UFCS (require, m, CPP2_UFCS_0 (make_public, m),
1055
1047
" all struct members must be public" );
@@ -1060,8 +1052,7 @@ auto cpp2_struct(meta::type_declaration& t) -> void
1060
1052
CPP2_UFCS (require, t, !(CPP2_UFCS (has_name, mf, " operator=" )),
1061
1053
" a struct may not have a user-defined operator=" );
1062
1054
}
1063
- }}
1064
- #line 697 "reflect.h2"
1055
+ }
1065
1056
basic_value (t); // a plain_struct is-a basic_value
1066
1057
}
1067
1058
0 commit comments