From 06193963d05d4e1c37273437428031b0127bc79b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 15 Oct 2013 07:01:17 +0200 Subject: Automatically map C++11 enum classes (strong enums) --- odb/details/config-vc.h | 6 ++++++ odb/details/config.hxx | 4 ++++ 2 files changed, 10 insertions(+) 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 -- cgit v1.1