@@ -117,6 +117,8 @@ options (po::options_description& d)
117117 " CDR streams." )
118118 (" cxx-cpp11" ,
119119 " Generate code that depends on C++11 features." )
120+ (" cxx-cpp17" ,
121+ " Generate code that depends on C++17 features." )
120122 ;
121123}
122124
@@ -332,7 +334,16 @@ generate (po::variables_map const& vm, Schema& schema, fs::path const& file_path
332334 bool cdr_reader (vm.count (" cxx-generate-cdr-reader-types" ));
333335 bool cdr_writer (vm.count (" cxx-generate-cdr-writer-types" ));
334336
335- bool cpp11 (vm.count (" cxx-cpp11" ));
337+ ::Context::CPPMODE cppmode_ { ::Context::CPPMODE::CPP03 };
338+ if (vm.count (" cxx-cpp11" ))
339+ {
340+ cppmode_ = ::Context::CPPMODE::CPP11;
341+ }
342+ if (vm.count (" cxx-cpp17" ))
343+ {
344+ cppmode_ = ::Context::CPPMODE::CPP17;
345+ }
346+
336347
337348 // Check about random access sequences
338349 bool ra_sequences (vm.count (" cxx-enable-random-access-sequences" ));
@@ -413,7 +424,7 @@ generate (po::variables_map const& vm, Schema& schema, fs::path const& file_path
413424 ctx.cdr_reader_generation (cdr_reader);
414425 ctx.cdr_writer_generation (cdr_writer);
415426
416- ctx.cpp11 (cpp11 );
427+ ctx.cppmode (cppmode_ );
417428
418429 // Add additional information to the context:
419430 ctx.generate_ra_sequences (ra_sequences);
@@ -455,7 +466,7 @@ generate (po::variables_map const& vm, Schema& schema, fs::path const& file_path
455466 ctx.cdr_reader_generation (cdr_reader);
456467 ctx.cdr_writer_generation (cdr_writer);
457468
458- ctx.cpp11 (cpp11 );
469+ ctx.cppmode (cppmode_ );
459470
460471 // Add additional information to the context:
461472 ctx.generate_ra_sequences (ra_sequences);
@@ -479,7 +490,7 @@ generate (po::variables_map const& vm, Schema& schema, fs::path const& file_path
479490 // Add additional information to the context:
480491 ctx.generate_ra_sequences (ra_sequences);
481492
482- ctx.cpp11 (cpp11 );
493+ ctx.cppmode (cppmode_ );
483494
484495 if (!inline_)
485496 {
0 commit comments