From 9bf40e4a91f6a792c3279d9184b67451cf58bf49 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 9 Dec 2015 18:02:40 +0200 Subject: Add --std option with c++{98,11,14} values; use function-static in C++11 This way we can use option descriptions during static initialization (e.g., of an Apache module). --- cli/option-types.hxx | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 cli/option-types.hxx (limited to 'cli/option-types.hxx') diff --git a/cli/option-types.hxx b/cli/option-types.hxx new file mode 100644 index 0000000..03cfbaa --- /dev/null +++ b/cli/option-types.hxx @@ -0,0 +1,34 @@ +// file : cli/option-types.hxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : MIT; see accompanying LICENSE file + +#ifndef CLI_OPTION_TYPES_HXX +#define CLI_OPTION_TYPES_HXX + +#include +#include + +struct cxx_version +{ + enum value + { + cxx98, + cxx11, + cxx14 + }; + + cxx_version (value v = value (0)) : v_ (v) {} + operator value () const {return v_;} + + std::string + string () const; + +private: + value v_; +}; + +std::istream& +operator>> (std::istream&, cxx_version&); + +#endif // CLI_OPTION_TYPES_HXX -- cgit v1.1