These modifications ensure enum.h can be used in a wider
selection of end user projects without triggering warnings.
GCC 4.9.2 was used with the following warning flags set:
-Wall -Wextra -Wshadow -Weffc++ -Wno-unused-parameter
-Wno-unused-local-typedefs -Wno-long-long -Wstrict-aliasing
-Werror -pedantic -std=c++1y -Wformat=2 -Wmissing-include-dirs
-Wsync-nand -Wuninitialized -Wconditionally-supported -Wconversion
-Wuseless-cast -Wzero-as-null-pointer-constant
This commit includes the modifications required to enable successful
use of enum.h via both the "test" and "example" directories.
enum.h tries to automatically detect whether it is running with C++11 support.
If not, it emits alternative code that is supposed to work on compilers
supporting C++98 and variadic macros. This code is largely interface-compatible
with the C++11 code, with the following semantic differences:
- No compile-time stringization. This is done upon first use of a function other
than to_integral.
- Implicit conversion to integral types. This is due to the lack of enum class
support.
- The values _name, _names, _values are replaced with functions _name_, _names_,
_values_.