104 Commits

Author SHA1 Message Date
Anton Bachin
e5549fb18c Docs: add notes about enabling C4062 on msvc
Resolves #49.

[skip ci]
2018-08-07 16:00:36 -05:00
Anton Bachin
21417b76b9 Doc generator: remove stale tweet image references
[skip ci]
2018-08-07 15:56:33 -05:00
Anton Bachin
3558c94cc7 README: add some whitespace
[skip ci]
2018-08-07 15:37:26 -05:00
Zsolt Parragi
2fad3f60ee Enabled constexpr support for Visual Studio 2017 2017-09-14 22:42:11 -05:00
Anton Bachin
ecdc88f066 Fix Travis build
It seems that the g++4.5 package has been obsoleted:

  https://travis-ci.org/aantron/better-enums/jobs/271125909#L492

There also seems to be some kind of upstream problem with clang++3.5
when building in C++14 mode:

  https://travis-ci.org/aantron/better-enums/jobs/271125912#L1349

To unblock development, this commit removes the g++4.5 build, and allows
the clang++3.5 build to fail for now.

[skip appveyor]
2017-09-14 13:35:28 -05:00
cheny
73a1619cb7 Specialize map_compare for wchar_t (#44)
Add the template partial specialization:
    struct map_compare<const wchar_t*> {...}
2017-07-13 06:20:57 -05:00
Anuradha Dissanayake
6988e0509e Fix /W4 level warnings in MSVC++ 2015 (#41)
Remove unused variable names and use underlying class for enum (VS 2012
and above support strongly typed enums and will warn about incorrect
usage).
2017-07-02 10:30:01 -05:00
cheparukhin
37d8f987ca Add unused attribute to free functions (#27) 2016-07-19 00:18:33 +01:00
Zsolt Parragi
ab4c8583db Enabled constepxr support for clang-cl. 2016-07-09 14:50:19 +02:00
cheparukhin
f520b397e3 Merge pull request #22 from cheparukhin/master
Fix name resolution errors
2016-07-08 19:50:32 +01:00
cheparukhin
c71b891c87 Add test for ostream operator 2016-07-08 19:50:04 +01:00
cheparukhin
d94b21a7e0 Resolve clashing global and nested namespace names
Using better_enums as a nested namespace name along a global better_enums namespace resulted in name clashes.
2016-06-22 15:52:35 +01:00
cheparukhin
9e522eaf3c Move stream I/O operators to enum namespace
Stream I/O operators defined in a global namespace caused name resolution errors in some cases.
2016-06-22 15:47:29 +01:00
Anton Bachin
18cbeb0808 Simplified README. 2016-03-15 18:29:12 -05:00
Anton Bachin
2d6b337419 Bumped version to 0.11.1. 0.11.1 2016-03-14 10:51:05 -05:00
Mitsutaka Takeda
e6e8e24f5c Fixed old-style cast warnings. 2016-03-12 20:33:33 -06:00
Anton Bachin
a500851e28 Documentation nits. 2016-03-03 10:12:48 -06:00
Anton Bachin
cc9cce28ae Enabled more warnings during testing.
To avoid problems with warnings in CxxTest, the extra warnings are
enabled during one test (linking) that does not use CxxTest.

Resolves #16.
2016-02-27 00:53:35 -06:00
Anton Bachin
9a754681c9 Local testing on more versions of Clang. 2016-02-27 00:19:50 -06:00
Mikhail Ovchinnikov
76ad2256dd Removed double underscores from macro names.
Names containing (and not only beginning with) double underscores are
reserved in C++.

Resolves #15.
2016-02-24 12:24:56 -06:00
Anton Bachin
f45897fcb3 README nit. 2016-02-12 12:27:11 -06:00
Anton Bachin
472a33fb64 Incorporated errata.
Fixes #13.
Fixes #14.

[ci skip]
2015-12-10 18:02:33 -06:00
Anton Bachin
f148cc4314 Disabled constexpr testing on MSVC.
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.
2015-11-17 15:17:15 -06:00
Anton Bachin
e8d51bdd8e Fixed README. 2015-10-07 11:18:51 -05:00
Anton Bachin
d99bae7284 Updated documentation. 0.11.0 2015-10-06 15:19:39 -05:00
Anton Bachin
e9b6792922 Reordered some member functions.
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.
2015-10-05 13:15:04 -05:00
Anton Bachin
8061c24191 Added Clang++ 3.7 to test matrix. 2015-10-05 13:15:04 -05:00
Anton Bachin
fc0b0de647 Made default constructor customizable by a macro.
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.
2015-10-04 19:03:21 -05:00
Anton Bachin
1620410372 Fixed example/Makefile. 2015-10-04 18:37:23 -05:00
Anton Bachin
9a2389cd15 Eliminated non-integral underlying types.
This was an experimental feature. Removing it to simplify maintenance.
2015-10-04 18:34:57 -05:00
Anton Bachin
c1d4a1c006 Fixed #ifdef that caused some tests not to run.
Disabled some tests that were failing due to unsupported type traits in
Travis standard library installation.
2015-10-04 12:34:19 -05:00
Anton Bachin
e1e237a4ea Renamed top-level macro ENUM to BETTER_ENUM.
To reduce name clashes.

Fixes #11.
2015-10-04 11:03:08 -05:00
Anton Bachin
977f8ef145 Replaced testing on G++ 5.1 with G++ 5.2.
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.
2015-08-23 12:41:42 -05:00
Anton Bachin
0595a526e7 Updated AppVeyor configuration.
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.
2015-08-23 12:38:56 -05:00
Anton Bachin
eac6afacdc Bidirectional maps between enums and any types.
Also added a C++14 configuration to testing, but using it only for
bidrectional map testing at the moment.
2015-07-11 19:32:28 -05:00
Anton Bachin
0f816be0cd Restored clang 3.6 and 3.5 in the Travis build.
Now that llvm.org is back up and Travis is able to download the
compiler binaries.
2015-07-11 17:29:09 -05:00
Anton Bachin
60a4f4dfda Updated documentation. 2015-07-11 15:27:43 -05:00
Anton Bachin
f404ea709b Made N4428 implementation more exact.
See http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4428.pdf
2015-07-11 15:25:48 -05:00
Anton Bachin
30efe7ccd7 Temporarily removed clang 3.5 and 3.6 in Travis.
I am still testing against these locally. Travis is having difficulty
installing them in build instances, perhaps due to the current llvm.org
outage.
2015-07-11 15:19:34 -05:00
Anton Bachin
6c3d02b951 Fixed bug that disallowed some constant names.
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.
2015-07-11 10:23:34 -05:00
Anton Bachin
f1a0b5d0e4 Simple implementation of N4428 enum reflection. 2015-07-09 18:29:44 -05:00
Anton Bachin
b182e16ec3 Local testing on VC2010 and VC2012.
Also improved the documentation Makefile not to re-generate the samples
unless the source Markdown files are newer. This should make samples
development easier.
2015-07-09 18:28:11 -05:00
Anton Bachin
9273051e07 Updated documentation and appearance. 0.10.1 2015-07-09 00:38:45 -05:00
Anton Bachin
7cfd738c1a Included VC2008 in AppVeyor and local testing.
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.
2015-07-08 09:25:48 -05:00
Anton Bachin
6278793a0b Added workarounds for VC2008.
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.
2015-07-07 11:22:40 -05:00
Anton Bachin
124c09f2f0 Sped up the AppVeyor build.
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.
2015-07-02 18:17:06 -05:00
Anton Bachin
89a1c1a64b Updated CONTRIBUTING.md and related information. 2015-07-02 16:56:33 -05:00
Alexander Buddenbrock
1769fbb6b7 Added support for testing in Travis. 2015-07-02 15:51:01 -05:00
Anton Bachin
07fef34465 Not assuming bash in testing scripts. 2015-07-02 10:56:37 -05:00
Anton Bachin
3c3733c700 Support for testing in AppVeyor.
Tests are run for VC2010, VC2012, VC2013, VC2015.
2015-07-01 23:58:23 -05:00