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 {
144144 OS << " , flags = " << Flags << " )" ;
145145}
146146
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+ }
150154};
151-
152- template <class ... Ts> OverloadMethods (Ts...) -> OverloadMethods<Ts...>;
155+ } // namespace
153156
154157void dumpRootElements (raw_ostream &OS, ArrayRef<RootElement> Elements) {
158+ ElementDumper Dumper{OS};
155159 OS << " RootElements{" ;
156160 bool First = true ;
157161 for (const RootElement &Element : Elements) {
158162 if (!First)
159163 OS << " ," ;
160164 OS << " " ;
161165 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);
166167 }
167168 OS << " }" ;
168169}
You can’t perform that action at this time.
0 commit comments