aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2013-10-15 07:01:17 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2013-10-15 07:01:17 +0200
commit06193963d05d4e1c37273437428031b0127bc79b (patch)
tree5b2c49dc8a914e5255bbcadffe2b3620012ff4c7
parentb0dbf155d92631e1861dac515e31c2b5ca3eba6a (diff)
Automatically map C++11 enum classes (strong enums)
-rw-r--r--odb/details/config-vc.h6
-rw-r--r--odb/details/config.hxx4
2 files changed, 10 insertions, 0 deletions
diff --git a/odb/details/config-vc.h b/odb/details/config-vc.h
index 7897360..ab7164e 100644
--- a/odb/details/config-vc.h
+++ b/odb/details/config-vc.h
@@ -21,6 +21,12 @@
//# define ODB_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGUMENT
//# define ODB_CXX11_VARIADIC_TEMPLATES
//# define ODB_CXX11_INITIALIZER_LIST
+
+// Strongly typed enums are supported starting from VC++11.
+//
+# if _MSC_VER >= 1700
+# define ODB_CXX11_ENUM
+# endif
#endif
#endif /* ODB_DETAILS_CONFIG_VC_H */
diff --git a/odb/details/config.hxx b/odb/details/config.hxx
index 74f397c..4130fc3 100644
--- a/odb/details/config.hxx
+++ b/odb/details/config.hxx
@@ -39,6 +39,10 @@
# define ODB_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGUMENT
# define ODB_CXX11_VARIADIC_TEMPLATE
# define ODB_CXX11_INITIALIZER_LIST
+// GCC supports strongly typed enums from 4.4 (forward -- 4.6),
+// Clang -- 2.9 (3.1).
+//
+# define ODB_CXX11_ENUM
# endif
#endif