Skip to content

Commit d13a126

Browse files
authored
Merge pull request aeron-io#371 from rigtorp/remove_function
Use universal reference instead of paying std::function overhead
2 parents 242e2c8 + 99ba75c commit d13a126

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ private static void generateGroupClassHeader(
307307
indent + " }\n" +
308308
indent + " }\n\n" +
309309
indent + "#else\n" +
310-
indent + " inline void forEach(std::function<void(%1$s&)> func)\n" +
310+
indent + " template<class Func> inline void forEach(Func&& func)\n" +
311311
indent + " {\n" +
312312
indent + " while(hasNext())\n" +
313313
indent + " {\n" +
@@ -839,7 +839,6 @@ private static CharSequence generateFileHeader(
839839
"#endif\n\n" +
840840
"#if __cplusplus >= 201103L\n" +
841841
"# include <cstdint>\n" +
842-
"# include <functional>\n" +
843842
"# include <string>\n" +
844843
"# include <cstring>\n" +
845844
"#endif\n\n" +

0 commit comments

Comments
 (0)