Until recently, CMake reported VS2015 as not supporting constexpr.
However, constexpr support was added in the VS2015 release, and CMake
now reports accordingly.
The constexpr support in VS2015 is too buggy to build Better Enums.
This change disables testing on VS2015 with constexpr support, because
those tests will fail.
Also adapted to a change in the Cygwin path prefix in AppVeyor and
fixed an issue in the Travis build with wget being unable to retrieve
from www.cmake.org's new redirect to cmake.org.
Microsoft's incomplete constexpr implementation does not currently
allow constexpr use of constexpr functions that are defined out of line
below their point of use. The reordering in this commit is a
workaround.
While this still doesn't give MSVC constexpr support due to additional
bugs in Microsoft's implementation, maintaining the member functions in
this order makes it easier to begin each attempt to work around the
remaining compiler bugs.
By default, Better Enums will generate with an inaccessible (private or
deleted) default constructor. However, if the user defines
BETTER_ENUMS_DEFAULT_CONSTRUCTOR(Enum), the expansion of that macro
will be used instead. The macro approach was chosen because the
expansion can include access modifiers and fragments such as
"= default".
Resolves#10.
GCC 5.2 is a "bugfix" release over GCC 5.1 - not sure why the GCC team
updated the minor version number. Package managers seem to have dropped
GCC 5.1 and replaced it with 5.2, and I'm guessing usage of 5.1 is
discouraged. The testing code has been updated accordingly.
Travis is still distributing GCC 5.1 as of the time of this writing.
Since VS2015 RTM, AppVeyor provides an image that has both VS2015 and
Cygwin pre-installed. Before this change, I had combined the build
matrix into one row, because of the need to install Cygwin in each
build worker, which is a 10-15-minute process. Since this is no longer
necessary, the matrix is restored. AppVeyor builds are now very fast.
The user-supplied constant names are used to declare an internal enum
type. They end up sharing a namespace with some internal library
values. Those internal values had names not prefixed with underscores.
As a result, it was impossible to declare enum constants with these
names.
Prefixed the internal names with underscores.
Also improved the documentation Makefile not to re-generate the samples
unless the source Markdown files are newer. This should make samples
development easier.
Also reordered compilers so that the very first tested are the ones
that support the most configurations, then immediately followed by
those which are the most likely to fail. Typically, this would be the
oldest ones, or the compiler versions that were the first to support
some major features.
VC2008 has two quirks. It generates linking errors if a copy
constructor is not explicitly defined on a Better Enum, and it has a
buggy interaction between the ternary operator and throw. This change
detects VC2008 and generates alternative code for that compiler.
Having an explicitly-defined copy constructor in a literal type appears
to cause an internal compiler error in g++4.7, and causes a spurious
compilation failure in g++4.8. For this reason, the copy constructor
generation is conditioned on the compiler.
The replacement code for the ternary operator is also generated
conditionally, because it uses an if-statement. The normal code has to
compile in a constexpr context, and so has to use the ternary operator
instead of the if-statement.
Resolves#6.
Current AppVeyor images with VC2015 don't have Cygwin pre-installed, so
each row in the build matrix installs it before running the build. This
takes about 7-8 minutes per row.
This change combines all the VC testing into one row, so the price of
installing Cygwin is paid only once. A secondary improvement is that
individual rows don't have to wait in the AppVeyor queue. Builds now
take a total of about 15 minutes, instead of approximately an hour,
including queueing time.
This change should probably be undone once there is an AppVeyor image
that comes with both VC2015 and Cygwin. The main AppVeyor image has VC
up to 2013 and Cygwin, so I suppose VC2015 and Cygwin will be available
once a final version of VC2015 is released.
Until then, Better Enums does not have the benefit of separate rows in
the AppVeyor build matrix.
To run tests with the system compiler, execute
make
To run tests with the system compiler in all configurations,
make default-all
To re-generate the examples from the documentation Markdown, and then
test all configurations,
make default-thorough
Other Makefile targets are for exhaustive testing with multiple
locally-installed compilers, or for use on CI servers, and are not for
general use.
Python and CxxTest are still required. On Windows, it is helpful to
have a Cygwin environment with a non-Cygwin CMake, and MSBuild.exe
should be in PATH.
Better Enums is now tested in fewer configurations. C++11 features are
no longer tested on clang 3.3, gcc 4.3-4.6, because CMake claims
(apparently falsely, in some cases) that those compilers don't support
constexpr and enum class.
These are now only assumed in C++11 mode. long long is also assumed
only in C++11 mode for clang, which may make some programs that rely on
long long as an extension in C++98 fail with Better Enums. I will solve
that at a later date if it becomes a problem.
The so called 'cygwin_fix_command' replaces all instances of '/home'
with 'C:/cygwin/home'. This will cause the tests to fail on linux as
this directory does not exist there.
Documentation can be generated by going to doc/ and running "make".
This requires Python. Before this change, the user had to install the
mistune library, which is used by the generator. The mistune library is
now included in the Better Enums distribution.
The generated docs are available at doc/html/index.html. Note that some
links won't be local (the GitHub repo, the download link, outgoing
links to MSDN, tutorial source in the GitHub repo, and so on). All the
pages belonging to the actual docs will be local, however.
The online version of the docs can be generated by running "make web".
The only difference between the online and offline versions is that the
former includes Google Analytics tracking code, and may include social
communication buttons, comment section, or other useless things in the
future.
Also included errata since the last release.
Resolves#2.
An alternative constant _size_constant is provided for use in C++98,
for example for declaring arrays.
Also renamed underlying_traits to integral_mapping.