@@ -34,54 +34,46 @@ void cpp_idt::print(std::ostream &out, unsigned indent) const
34
34
35
35
if (!sub.empty ())
36
36
{
37
- for (cpp_id_mapt::const_iterator it=sub.begin ();
38
- it!=sub.end ();
39
- it++)
40
- it->second .print (out, indent+2 );
37
+ for (const auto &s : sub)
38
+ s.second .print (out, indent + 2 );
41
39
42
40
out << ' \n ' ;
43
41
}
44
42
}
45
43
46
44
void cpp_idt::print_fields (std::ostream &out, unsigned indent) const
47
45
{
48
- for ( unsigned i= 0 ; i<indent; i++) out << ' ' ;
46
+ out << std::string (indent, ' ' ) ;
49
47
out << " **identifier=" << identifier << ' \n ' ;
50
48
51
- for ( unsigned i= 0 ; i<indent; i++) out << ' ' ;
49
+ out << std::string (indent, ' ' ) ;
52
50
out << " prefix=" << prefix << ' \n ' ;
53
51
54
- for ( unsigned i= 0 ; i<indent; i++) out << ' ' ;
52
+ out << std::string (indent, ' ' ) ;
55
53
out << " suffix=" << suffix << ' \n ' ;
56
54
57
- for ( unsigned i= 0 ; i<indent; i++) out << ' ' ;
55
+ out << std::string (indent, ' ' ) ;
58
56
out << " base_name=" << base_name << ' \n ' ;
59
57
60
- for ( unsigned i= 0 ; i<indent; i++) out << ' ' ;
58
+ out << std::string (indent, ' ' ) ;
61
59
out << " method=" << is_method << ' \n ' ;
62
60
63
- for ( unsigned i= 0 ; i<indent; i++) out << ' ' ;
61
+ out << std::string (indent, ' ' ) ;
64
62
out << " class_identifier=" << class_identifier << ' \n ' ;
65
63
66
- for (scope_listt::const_iterator
67
- it=secondary_scopes.begin ();
68
- it!=secondary_scopes.end ();
69
- it++)
64
+ for (const auto &s : secondary_scopes)
70
65
{
71
- for ( unsigned i= 0 ; i<indent; i++) out << ' ' ;
72
- out << " secondary_scope=" << (*it) ->identifier << ' \n ' ;
66
+ out << std::string (indent, ' ' ) ;
67
+ out << " secondary_scope=" << s ->identifier << ' \n ' ;
73
68
}
74
69
75
- for (scope_listt::const_iterator
76
- it=using_scopes.begin ();
77
- it!=using_scopes.end ();
78
- it++)
70
+ for (const auto &s : using_scopes)
79
71
{
80
- for ( unsigned i= 0 ; i<indent; i++) out << ' ' ;
81
- out << " using_scope=" << (*it) ->identifier << ' \n ' ;
72
+ out << std::string (indent, ' ' ) ;
73
+ out << " using_scope=" << s ->identifier << ' \n ' ;
82
74
}
83
75
84
- for ( unsigned i= 0 ; i<indent; i++) out << ' ' ;
76
+ out << std::string (indent, ' ' ) ;
85
77
out << " flags:" ;
86
78
if (is_constructor)
87
79
out << " constructor" ;
@@ -93,7 +85,7 @@ void cpp_idt::print_fields(std::ostream &out, unsigned indent) const
93
85
out << " static_member" ;
94
86
out << ' \n ' ;
95
87
96
- for ( unsigned i= 0 ; i<indent; i++) out << ' ' ;
88
+ out << std::string (indent, ' ' ) ;
97
89
out << " id_class=" << id_class << ' \n ' ;
98
90
}
99
91
0 commit comments