Skip to content

Commit cc441b0

Browse files
committed
[C++] Generate skip function without use of lambdas or templates. Issue #903.
1 parent d5966bf commit cc441b0

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/cpp/CppGenerator.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3109,8 +3109,11 @@ private CharSequence generateMessageLength(final List<Token> groups, final List<
31093109
}
31103110

31113111
new Formatter(sbSkip).format(
3112-
indent + " %2$s().forEach([](%1$s &e){ e.skip(); });\n",
3113-
formatClassName(groupToken.name()),
3112+
indent + (" auto &%1$sGroup { %1$s() };\n") +
3113+
indent + (" while (%1$sGroup.hasNext())\n") +
3114+
indent + (" {\n") +
3115+
indent + (" %1$sGroup.next().skip();\n") +
3116+
indent + (" }\n"),
31143117
formatPropertyName(groupToken.name()));
31153118

31163119
i = endSignal;

0 commit comments

Comments
 (0)