diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2015-12-09 18:02:40 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2015-12-09 18:02:40 +0200 |
commit | 9bf40e4a91f6a792c3279d9184b67451cf58bf49 (patch) | |
tree | a242a923ec7d309dc488c60f1233fbc91fcbae70 /cli/option-types.hxx | |
parent | bd21176187a55fa7f6e80b5cfe86f5e756971b4f (diff) |
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).
Diffstat (limited to 'cli/option-types.hxx')
-rw-r--r-- | cli/option-types.hxx | 34 |
1 files changed, 34 insertions, 0 deletions
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 <boris@codesynthesis.com> +// 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 <iosfwd> +#include <string> + +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 |