Compare commits

...

7 Commits

Author SHA1 Message Date
Anton Bachin
520d8ee390 Update copyright year 2024-01-07 15:20:03 +03:00
Chris Heyes
d65550f378
Turn off clang-format (#118)
Turns off clang-format for easier usage in projects using it.
2024-01-07 15:18:17 +03:00
Anton Bachin
1e8f499ddf Update copyright year 2021-09-09 14:18:02 +03:00
Anton Bachin
f3ff0a6917 Remove version link from README
[skip ci]
2020-11-08 08:37:41 +03:00
Anton Bachin
68ca02d1f5 Replace tab by spaces
[skip ci]
2020-11-08 08:28:09 +03:00
Anton Bachin
517387fba0 Docs: rely on GitHub issues only for contact
[skip ci]
2020-10-19 09:11:14 +03:00
Anton Bachin
fb8b398b02 README: remove link to magic_enum
There are now several alternative enum libraries, so the README no
longer seems to be a convenient place for linking them. At this point,
they should be quite discoverable on their own.

See https://github.com/aantron/better-enums/issues/89#issuecomment-706870187.
Closes #78.

[skip ci]
2020-10-19 09:05:45 +03:00
6 changed files with 7 additions and 41 deletions

View File

@ -1,4 +1,4 @@
Copyright (c) 2012-2020, Anton Bachin Copyright (c) 2012-2024, Anton Bachin
All rights reserved. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, Redistribution and use in source and binary forms, with or without modification,

View File

@ -1,7 +1,5 @@
# Better Enums   [![version 0.11.2][version]][releases] [![Try online][wandbox-img]][wandbox] [![Travis status][travis-img]][travis] [![AppVeyor status][appveyor-img]][appveyor] # Better Enums   [![Try online][wandbox-img]][wandbox] [![Travis status][travis-img]][travis] [![AppVeyor status][appveyor-img]][appveyor]
[version]: https://img.shields.io/badge/version-0.11.2-blue.svg
[releases]: https://github.com/aantron/better-enums/releases
[wandbox]: http://melpon.org/wandbox/permlink/2QCi3cwQnplAToge [wandbox]: http://melpon.org/wandbox/permlink/2QCi3cwQnplAToge
[wandbox-img]: https://img.shields.io/badge/try%20it-online-blue.svg [wandbox-img]: https://img.shields.io/badge/try%20it-online-blue.svg
[appveyor]: https://ci.appveyor.com/project/aantron/better-enums/branch/master [appveyor]: https://ci.appveyor.com/project/aantron/better-enums/branch/master
@ -17,10 +15,6 @@ file, and without dependencies.
[sample]: https://raw.githubusercontent.com/aantron/better-enums/master/doc/image/sample.gif [sample]: https://raw.githubusercontent.com/aantron/better-enums/master/doc/image/sample.gif
**Note**: consider [**magic_enum**](https://github.com/Neargye/magic_enum)
(note it requires C++17 and a fairly recent compiler; see
[*Limitations*](https://github.com/Neargye/magic_enum/blob/master/doc/limitations.md#readme)).
In C++11, *everything* can be used at compile time. You can convert your enums, In C++11, *everything* can be used at compile time. You can convert your enums,
loop over them, [find their max][max], loop over them, [find their max][max],
[statically enforce conventions][enforce], and pass along the results as [statically enforce conventions][enforce], and pass along the results as
@ -102,20 +96,6 @@ a comparison:
<br/> <br/>
## Contact and development
Don't hesitate to contact me about features or bugs:
[antonbachin@yahoo.com][email], or open an issue on GitHub.
If you'd like to help develop Better Enums, see [`CONTRIBUTING`][contributing].
One area that could use fresh ideas is finding a compile-time data structure
that both compiles quickly and allows lookup in sub-linear time.
[email]: mailto:antonbachin@yahoo.com
[contributing]: https://github.com/aantron/better-enums/blob/master/doc/CONTRIBUTING.md
<br/>
## History ## History
The original version of the library was developed by the author in the winter of The original version of the library was developed by the author in the winter of

View File

@ -1,15 +0,0 @@
## Contact
- Send me an email: [antonbachin@yahoo.com](mailto:antonbachin@yahoo.com).
- Visit the [GitHub]($repo) project to open an issue or get a development
version.
I'm happy to hear any feedback. If you have any trouble using the library or
parsing the documentation, please don't hesitate to let me know. I'd also be
interested to hear about your use case, if you are willing to share :)
And, if you find this library helpful, give it a star on GitHub to let me know
you use it :)
%% description =
Contact information for Better Enums bugs, issues, support, and feedback.

View File

@ -3,7 +3,7 @@
<footer> <footer>
<div class="container"> <div class="container">
Copyright &copy; 2015-2019 Anton Bachin. Released under the BSD 2-clause Copyright &copy; 2015-2024 Anton Bachin. Released under the BSD 2-clause
license. See license. See
<a href="https://github.com/aantron/better-enums/blob/$ref/doc/LICENSE"> <a href="https://github.com/aantron/better-enums/blob/$ref/doc/LICENSE">
LICENSE</a>. LICENSE</a>.

View File

@ -25,7 +25,6 @@ $ga
<a href="${prefix}index.html">Home</a> <a href="${prefix}index.html">Home</a>
<a href="${prefix}tutorial/HelloWorld.html">Tutorial</a> <a href="${prefix}tutorial/HelloWorld.html">Tutorial</a>
<a href="${prefix}ApiReference.html">Reference</a> <a href="${prefix}ApiReference.html">Reference</a>
<a href="${prefix}Contact.html">Contact</a>
</div> </div>
</nav> </nav>

6
enum.h
View File

@ -1,6 +1,7 @@
// This file is part of Better Enums, released under the BSD 2-clause license. // This file is part of Better Enums, released under the BSD 2-clause license.
// See LICENSE.md for details, or visit http://github.com/aantron/better-enums. // See LICENSE.md for details, or visit http://github.com/aantron/better-enums.
// clang-format off
#pragma once #pragma once
#ifndef BETTER_ENUMS_ENUM_H #ifndef BETTER_ENUMS_ENUM_H
@ -1313,7 +1314,7 @@ BETTER_ENUMS_CONSTEXPR_ map<Enum, T> make_map(T (*f)(Enum))
} }
#define BETTER_ENUMS_DECLARE_STD_HASH(type) \ #define BETTER_ENUMS_DECLARE_STD_HASH(type) \
namespace std { \ namespace std { \
template <> struct hash<type> \ template <> struct hash<type> \
{ \ { \
size_t operator()(const type &x) const \ size_t operator()(const type &x) const \
@ -1321,6 +1322,7 @@ BETTER_ENUMS_CONSTEXPR_ map<Enum, T> make_map(T (*f)(Enum))
return std::hash<size_t>()(x._to_integral()); \ return std::hash<size_t>()(x._to_integral()); \
} \ } \
}; \ }; \
} }
#endif // #ifndef BETTER_ENUMS_ENUM_H #endif // #ifndef BETTER_ENUMS_ENUM_H
// clang-format on