File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/cpp Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -294,13 +294,22 @@ private static void generateGroupClassHeader(
294294 dimensionHeaderLength , blockLength , formatClassName (groupName )));
295295
296296 sb .append (
297- indent + " template<class Func> inline void forEach(Func func)\n " +
297+ indent + " template<class Func> inline void forEach(Func& func)\n " +
298298 indent + " {\n " +
299299 indent + " while (hasNext())\n " +
300300 indent + " {\n " +
301301 indent + " next(); func(*this);\n " +
302302 indent + " }\n " +
303- indent + " }\n \n " );
303+ indent + " }\n " +
304+ indent + "#if __cplusplus >= 201103L\n " +
305+ indent + " template<class Func> inline void forEach(Func&& func)\n " +
306+ indent + " {\n " +
307+ indent + " while (hasNext())\n " +
308+ indent + " {\n " +
309+ indent + " next(); func(*this);\n " +
310+ indent + " }\n " +
311+ indent + " }\n " +
312+ indent + "#endif\n \n
304313 }
305314
306315 private static CharSequence generateGroupProperty(
You can’t perform that action at this time.
0 commit comments