aboutsummaryrefslogtreecommitdiff
path: root/odb/option-types.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2012-02-23 10:47:16 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2012-02-23 10:47:16 +0200
commitbb811b27cffbeb4c24d9d3f2e739f99eab8299ec (patch)
tree28aec7f2dd521cca2ed34ddacf344cf0aa89c474 /odb/option-types.cxx
parent3a1eed21d4d5d0e7f6a9f400420fdc28d7be9b61 (diff)
Add --std option that allows selecting between C++98 and C++11
Diffstat (limited to 'odb/option-types.cxx')
-rw-r--r--odb/option-types.cxx35
1 files changed, 35 insertions, 0 deletions
diff --git a/odb/option-types.cxx b/odb/option-types.cxx
index cfe1f06..3bbe72e 100644
--- a/odb/option-types.cxx
+++ b/odb/option-types.cxx
@@ -12,6 +12,41 @@
using namespace std;
//
+// cxx_version
+//
+
+static const char* cxx_version_[] =
+{
+ "c++98",
+ "c++11"
+};
+
+const char* cxx_version::
+string () const
+{
+ return cxx_version_[v_];
+}
+
+istream&
+operator>> (istream& is, cxx_version& v)
+{
+ string s;
+ is >> s;
+
+ if (!is.fail ())
+ {
+ if (s == "c++98")
+ v = cxx_version::cxx98;
+ else if (s == "c++11")
+ v = cxx_version::cxx11;
+ else
+ is.setstate (istream::failbit);
+ }
+
+ return is;
+}
+
+//
// database
//