Skip to content

Commit afc0f98

Browse files
committed
Use inline constexpr for C++17 and higher in generated header
1 parent a9cc503 commit afc0f98

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

extern/cloop/src/cloop/Generator.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,9 @@ void CppGenerator::generate()
191191
fprintf(out, "#endif\n\n\n");
192192

193193
fprintf(out, "#ifndef CLOOP_CONSTEXPR\n");
194-
fprintf(out, "#if __cplusplus >= 201103L\n");
194+
fprintf(out, "#if __cplusplus >= 201703L\n");
195+
fprintf(out, "#define CLOOP_CONSTEXPR inline constexpr\n");
196+
fprintf(out, "#elif __cplusplus >= 201103L\n");
195197
fprintf(out, "#define CLOOP_CONSTEXPR constexpr\n");
196198
fprintf(out, "#else\n");
197199
fprintf(out, "#define CLOOP_CONSTEXPR const\n");

0 commit comments

Comments
 (0)