File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -144,25 +144,26 @@ void DescriptorTableClause::dump(raw_ostream &OS) const {
144
144
OS << " , flags = " << Flags << " )" ;
145
145
}
146
146
147
- // Helper struct so that we can use the overloaded notation of std::visit
148
- template <class ... Ts> struct OverloadMethods : Ts... {
149
- using Ts::operator ()...;
147
+ // Helper callable so that we can use the overloaded notation of std::visit
148
+ namespace {
149
+ struct ElementDumper {
150
+ raw_ostream &OS;
151
+ template <typename T> void operator ()(const T &Element) const {
152
+ Element.dump (OS);
153
+ }
150
154
};
151
-
152
- template <class ... Ts> OverloadMethods (Ts...) -> OverloadMethods<Ts...>;
155
+ } // namespace
153
156
154
157
void dumpRootElements (raw_ostream &OS, ArrayRef<RootElement> Elements) {
158
+ ElementDumper Dumper{OS};
155
159
OS << " RootElements{" ;
156
160
bool First = true ;
157
161
for (const RootElement &Element : Elements) {
158
162
if (!First)
159
163
OS << " ," ;
160
164
OS << " " ;
161
165
First = false ;
162
- std::visit (OverloadMethods{
163
- [&OS](DescriptorTable Table) { Table.dump (OS); },
164
- [&OS](DescriptorTableClause Clause) { Clause.dump (OS); }},
165
- Element);
166
+ std::visit (Dumper, Element);
166
167
}
167
168
OS << " }" ;
168
169
}
You can’t perform that action at this time.
0 commit comments