mirror of
https://github.com/aantron/better-enums.git
synced 2025-12-07 01:06:42 +08:00
Compare commits
No commits in common. "master" and "0.11.3" have entirely different histories.
@ -1,4 +1,4 @@
|
||||
Copyright (c) 2012-2024, Anton Bachin
|
||||
Copyright (c) 2012-2020, Anton Bachin
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
|
||||
22
README.md
22
README.md
@ -1,5 +1,7 @@
|
||||
# Better Enums [![Try online][wandbox-img]][wandbox] [![Travis status][travis-img]][travis] [![AppVeyor status][appveyor-img]][appveyor]
|
||||
# Better Enums [![version 0.11.2][version]][releases] [![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-img]: https://img.shields.io/badge/try%20it-online-blue.svg
|
||||
[appveyor]: https://ci.appveyor.com/project/aantron/better-enums/branch/master
|
||||
@ -15,6 +17,10 @@ file, and without dependencies.
|
||||
|
||||
[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,
|
||||
loop over them, [find their max][max],
|
||||
[statically enforce conventions][enforce], and pass along the results as
|
||||
@ -96,6 +102,20 @@ a comparison:
|
||||
|
||||
<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
|
||||
|
||||
The original version of the library was developed by the author in the winter of
|
||||
|
||||
15
doc/Contact.md
Normal file
15
doc/Contact.md
Normal file
@ -0,0 +1,15 @@
|
||||
## 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.
|
||||
2
doc/template/footer.tmpl
vendored
2
doc/template/footer.tmpl
vendored
@ -3,7 +3,7 @@
|
||||
|
||||
<footer>
|
||||
<div class="container">
|
||||
Copyright © 2015-2024 Anton Bachin. Released under the BSD 2-clause
|
||||
Copyright © 2015-2019 Anton Bachin. Released under the BSD 2-clause
|
||||
license. See
|
||||
<a href="https://github.com/aantron/better-enums/blob/$ref/doc/LICENSE">
|
||||
LICENSE</a>.
|
||||
|
||||
1
doc/template/header.tmpl
vendored
1
doc/template/header.tmpl
vendored
@ -25,6 +25,7 @@ $ga
|
||||
<a href="${prefix}index.html">Home</a>
|
||||
<a href="${prefix}tutorial/HelloWorld.html">Tutorial</a>
|
||||
<a href="${prefix}ApiReference.html">Reference</a>
|
||||
<a href="${prefix}Contact.html">Contact</a>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
|
||||
6
enum.h
6
enum.h
@ -1,7 +1,6 @@
|
||||
// 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.
|
||||
|
||||
// clang-format off
|
||||
#pragma once
|
||||
|
||||
#ifndef BETTER_ENUMS_ENUM_H
|
||||
@ -1314,7 +1313,7 @@ BETTER_ENUMS_CONSTEXPR_ map<Enum, T> make_map(T (*f)(Enum))
|
||||
}
|
||||
|
||||
#define BETTER_ENUMS_DECLARE_STD_HASH(type) \
|
||||
namespace std { \
|
||||
namespace std { \
|
||||
template <> struct hash<type> \
|
||||
{ \
|
||||
size_t operator()(const type &x) const \
|
||||
@ -1322,7 +1321,6 @@ BETTER_ENUMS_CONSTEXPR_ map<Enum, T> make_map(T (*f)(Enum))
|
||||
return std::hash<size_t>()(x._to_integral()); \
|
||||
} \
|
||||
}; \
|
||||
}
|
||||
}
|
||||
|
||||
#endif // #ifndef BETTER_ENUMS_ENUM_H
|
||||
// clang-format on
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user