129 Commits

Author SHA1 Message Date
Anton Bachin
3e115c0c17 Rename argument of _to_index, _from_index
Follow-on to #59.
2020-10-19 08:09:55 +03:00
Anton Bachin
c730fc8ae8 Document _to_index, _from_index, etc.
Follow-on to #59.

[skip ci]
2020-10-19 08:07:45 +03:00
Anton Bachin
f480b7ef1c Remove Patreon link
[skip ci]
2020-10-18 22:32:01 +03:00
Anton Bachin
1a3c4f9e5a Tweak note about magic_enum
Resolves #88.

[skip ci]
2020-10-08 21:50:05 +03:00
Anton Bachin
21c374914c Try GitHub Sponsors
[skip ci]
2020-01-23 01:53:00 +03:00
Jan-Gerd Tenberge
dcbd3c0554 Add BETTER_ENUMS_IGNORE_ATTRIBUTES_* for clang (#81) 2020-01-13 15:40:59 +03:00
Anton Bachin
89bc057a63 Update copyright year
[skip ci]
2020-01-01 18:16:19 +03:00
CJ Smith
5dcd59bd29 Ignores -Wattributes for GCC 7 and 8 to mask compiler bug. (#79)
See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89325
This bug produces massive amounts of spurious warnings and is present
in the version of g++ currently available in RHEL devtoolset-7 and devtoolset-8.
2019-12-07 08:15:47 +03:00
Michael Ernst
fa39f5c89e Add macro BETTER_ENUMS_CLASS_ATTRIBUTE for adding attributes to enum class (#80)
When not set it defaults to empty macro.
2019-12-06 23:23:25 +03:00
Anton Bachin
4b76e7783b Recommend magic_enum
[skip ci]
2019-08-17 23:06:40 +03:00
Anton Bachin
1ea7f04bb9 Move LICENSE so that GitHub recognizes it
[skip ci]
2019-07-25 20:16:35 +03:00
Anton Bachin
e1756cdb07 Docs: remove unnecessary scroll bars
[skip ci]
2019-07-25 20:14:08 +03:00
Sven Scharmentke
5a677ac72b Support using better-enum as key in dictionaries and maps (#77)
This enabled hashing so that unordered_map are supported.
2019-07-16 12:36:16 +03:00
Felipe Lema
8a0d376b53 fix -wold-style-cast (#74) 2019-06-19 12:47:57 -05:00
Anton Bachin
8b4d8a9499 Bump version to 0.11.2
[skip ci]
0.11.2
2019-04-02 10:01:36 -05:00
Anton Bachin
ebc0c0138e Fix some long lines 2019-04-02 09:49:47 -05:00
Anton Bachin
b838852ff4 Remove stray comment
[skip ci]
2019-04-02 09:47:53 -05:00
Anton Bachin
f626bcde1a Docs: note maps are also specialized for wchar_t
Follow-on to #44.

[skip ci]
2019-04-02 09:29:02 -05:00
Xeverous
509c544d0f removed tabs in unwanted places (#72)
2 lines had tabs in the middle of the code, between spaces. This can
cause warnings in some tools and red markings in Git when commiting
code (tabs are to be used only as the starting characters, never after
any character).

After this commit, there are no tabs in the file at all.
2019-04-02 09:28:40 -05:00
D4koon
ed21395b20 Fix for Visual Studio 2017 (#70) 2018-11-28 03:28:05 -06:00
Anton Bachin
2d2a6a5648 AppVeyor: test on Visual Studio 2017
This commit also drops testing on Visual Studio 2008-2012, as they seem
not to be supported by the AppVeyor image.
2018-11-28 02:30:59 -06:00
Anton Bachin
882dd9cd1b Travis: allow Clang 3.3 build to fail
There seems to be some upstream bit rot with Clang++ 3.3. This is a
pretty old version, and we may want to just stop testing on it. However,
in the meantime, it will be allowed to fail without failing the overall
build.

Resolves #63.

[skip appveyor]
2018-10-19 12:37:03 -05:00
Wojciech Bartnik
94f8f95a26 Added syntax highlight (#67) 2018-10-19 12:32:40 -05:00
Felix Dombek
df5df3924e Changed identifiers beginning with underscore followed by uppercase letters. (#62)
These are in violation of the C++ standard. Renamed by lowercasing the
offending letters.

Affected identifiers:

- _Iterable -> _iterable
- _PutNamesInThisScopeAlso -> _putNamesInThisScopeAlso
_ _enumClassForSwitchStatements -> _enumClassForSwitchStatements
2018-09-19 13:31:42 -05:00
Piotr Kosek
97d38d8077 Added indexable properties on enums (#59)
- _to_index which return value 0... size-1
        (even if enums are note sequential)
 - _from_index used for other way around
 - _from_index_nothrow no throw version
 - _from_index_unchecked returns invalid enum
        in case arg>=size

Code and test cases added.
No documentation updates (my English is too poor for that)
2018-09-06 17:39:31 -05:00
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