@@ -378,27 +378,14 @@ private static void generateGroupClassHeader(
378
378
.append (indent ).append (" }\n " );
379
379
380
380
sb .append ("\n " )
381
- .append (indent ).append ("#if __cplusplus < 201103L\n " )
382
- .append (indent ).append (" template<class Func> inline void forEach(Func &func)\n " )
383
- .append (indent ).append (" {\n " )
384
- .append (indent ).append (" while (hasNext())\n " )
385
- .append (indent ).append (" {\n " )
386
- .append (indent ).append (" next();\n " )
387
- .append (indent ).append (" func(*this);\n " )
388
- .append (indent ).append (" }\n " )
389
- .append (indent ).append (" }\n \n " )
390
-
391
- .append (indent ).append ("#else\n " )
392
381
.append (indent ).append (" template<class Func> inline void forEach(Func &&func)\n " )
393
382
.append (indent ).append (" {\n " )
394
383
.append (indent ).append (" while (hasNext())\n " )
395
384
.append (indent ).append (" {\n " )
396
385
.append (indent ).append (" next();\n " )
397
386
.append (indent ).append (" func(*this);\n " )
398
387
.append (indent ).append (" }\n " )
399
- .append (indent ).append (" }\n \n " )
400
-
401
- .append (indent ).append ("#endif\n " );
388
+ .append (indent ).append (" }\n \n " );
402
389
}
403
390
404
391
private static void generateGroupProperty (
@@ -2655,20 +2642,19 @@ private CharSequence appendDisplay(
2655
2642
new Formatter (sb ).format (
2656
2643
indent + "{\n " +
2657
2644
indent + " bool atLeastOne = false;\n " +
2658
- indent + " builder << R\" (\" %3 $s\" : [)\" ;\n " +
2659
- indent + " writer.%2 $s().forEach(\n " +
2660
- indent + " [&](%1$s &%2 $s)\n " +
2645
+ indent + " builder << R\" (\" %2 $s\" : [)\" ;\n " +
2646
+ indent + " writer.%1 $s().forEach(\n " +
2647
+ indent + " [&](auto &&%1 $s)\n " +
2661
2648
indent + " {\n " +
2662
2649
indent + " if (atLeastOne)\n " +
2663
2650
indent + " {\n " +
2664
2651
indent + " builder << \" , \" ;\n " +
2665
2652
indent + " }\n " +
2666
2653
indent + " atLeastOne = true;\n " +
2667
- indent + " builder << %2 $s;\n " +
2654
+ indent + " builder << %1 $s;\n " +
2668
2655
indent + " });\n " +
2669
2656
indent + " builder << ']';\n " +
2670
2657
indent + "}\n \n " ,
2671
- formatClassName (groupToken .name ()),
2672
2658
formatPropertyName (groupToken .name ()),
2673
2659
groupToken .name ());
2674
2660
@@ -3122,8 +3108,7 @@ private CharSequence generateMessageLength(final List<Token> groups, final List<
3122
3108
}
3123
3109
3124
3110
new Formatter (sbSkip ).format (
3125
- indent + " %2$s().forEach([](%1$s &e){ e.skip(); });\n " ,
3126
- formatClassName (groupToken .name ()),
3111
+ indent + " %1$s().forEach([](auto &&e){ e.skip(); });\n " ,
3127
3112
formatPropertyName (groupToken .name ()));
3128
3113
3129
3114
i = endSignal ;
0 commit comments