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 @@ -149,25 +149,26 @@ void DescriptorTableClause::dump(raw_ostream &OS) const {
149
149
OS << " )" ;
150
150
}
151
151
152
- // Helper struct so that we can use the overloaded notation of std::visit
153
- template <class ... Ts> struct OverloadMethods : Ts... {
154
- using Ts::operator ()...;
152
+ // Helper callable so that we can use the overloaded notation of std::visit
153
+ namespace {
154
+ struct ElementDumper {
155
+ raw_ostream &OS;
156
+ template <typename T> void operator ()(const T &Element) const {
157
+ Element.dump (OS);
158
+ }
155
159
};
156
-
157
- template <class ... Ts> OverloadMethods (Ts...) -> OverloadMethods<Ts...>;
160
+ } // namespace
158
161
159
162
void dumpRootElements (raw_ostream &OS, ArrayRef<RootElement> Elements) {
163
+ ElementDumper Dumper{OS};
160
164
OS << " RootElements{" ;
161
165
bool First = true ;
162
166
for (const RootElement &Element : Elements) {
163
167
if (!First)
164
168
OS << " ," ;
165
169
OS << " " ;
166
170
First = false ;
167
- std::visit (OverloadMethods{
168
- [&OS](DescriptorTable Table) { Table.dump (OS); },
169
- [&OS](DescriptorTableClause Clause) { Clause.dump (OS); }},
170
- Element);
171
+ std::visit (Dumper, Element);
171
172
}
172
173
OS << " }" ;
173
174
}
You can’t perform that action at this time.
0 commit comments