Skip to content

Commit ef1403c

Browse files
[Support] Use a C++17 fold expression in ScopedPrinter.h (NFC)
1 parent 065699b commit ef1403c

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

llvm/include/llvm/Support/ScopedPrinter.h

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -454,14 +454,10 @@ class LLVM_ABI ScopedPrinter {
454454
virtual raw_ostream &getOStream() { return OS; }
455455

456456
private:
457-
template <typename T> void printVersionInternal(T Value) {
457+
template <typename T, typename... TArgs>
458+
void printVersionInternal(T Value, TArgs... Args) {
458459
getOStream() << Value;
459-
}
460-
461-
template <typename S, typename T, typename... TArgs>
462-
void printVersionInternal(S Value, T Value2, TArgs... Args) {
463-
getOStream() << Value << ".";
464-
printVersionInternal(Value2, Args...);
460+
((getOStream() << '.' << Args), ...);
465461
}
466462

467463
static bool flagName(const FlagEntry &LHS, const FlagEntry &RHS) {

0 commit comments

Comments
 (0)