Magic Enum C++
Our great sponsors
|libCat||Magic Enum C++|
|about 1 month ago||1 day ago|
|GNU Affero General Public License v3.0||MIT License|
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
I hate almost all software
2 projects | news.ycombinator.com | 6 Jun 2023
That's awesome! I'm working on something that sounds similar. https://github.com/cons-cat/libcat
I'd love to see your work if you're willing to share it here!
Manticore 6.0.0 – a faster alternative to Elasticsearch in C++
6 projects | news.ycombinator.com | 10 Feb 2023
Chromium accepting Rust in a clear move to copy what Mozilla have done, replace C++ source code
4 projects | /r/cpp | 12 Jan 2023
It's worse in the standard library than it has to be. When I refactored my traits to minimize template instantiations and lean on concepts as much as possible, I measured over 30% improvement to clean build compile times. It's not possible for the standard to do this, because it would subtly change the API. For instance, you can't instantiate or take the address of a concept, but you can for a type-trait class. No reason you'd want to do that, but you can, so they can't "break" the standard library by optimizing this.
C++'s smaller cleaner language
11 projects | /r/cpp | 31 Dec 2022
This doesn't have to be true. Over the past year I've made progress towards demonstrating how even non-freestanding C++ can be written without any C or C++ standard library headers or DLLs (with large benefits). There are a few names which the compilers require to be in the std:: namespace, though, but they're very special features like source_location and construct_at with semantics that can't be expressed otherwise.
Is bloat in std::unexpected expected?
2 projects | /r/cpp | 15 Dec 2022
It isn't that hard to put a predicate into a type. We have lambdas in an unevaluated context, CTAD, and templated type aliases. https://github.com/Cons-Cat/libCat/blob/main/src/libraries/scaredy/cat/scaredy https://github.com/Cons-Cat/libCat/blob/main/src/global_includes.hpp#L70 https://github.com/Cons-Cat/libCat/blob/main/src/libraries/linux/cat/linux#L289 You do it like this.
Software disenchantment - why does modern programming seem to lack of care for efficiency, simplicity, and excellence
3 projects | /r/programming | 30 Nov 2022
tiny::optional – a C++ optional that does not waste memory
6 projects | /r/cpp | 23 Oct 2022
Rust analyzer/clippy alternative for C++?
2 projects | /r/cpp | 1 Sep 2022
I use clang-tidy. These are my current linting rules.
John "God" Carmack: C++ with a C flavor is still the best (also: Python performance "keeps hitting me in the face")
5 projects | /r/cpp | 21 Aug 2022
I'm working on this! https://github.com/Cons-Cat/LibCat
“Hello world” is slower in C++ than in C (Linux)
2 projects | /r/cpp | 9 Aug 2022
Magic Enum C++
enum_name (yet another enum to/from string conversion utility >=C++11)
4 projects | /r/cpp | 19 Mar 2023
What does this have to offer over magic_enum?
quill v2.7.0 released - Asynchronous Low Latency C++ Logging Library
3 projects | /r/cpp | 6 Feb 2023
But it's a hack, and I prefer not to use hacks in production, because of their significant limitations:
Enums with methods
2 projects | /r/cpp | 27 Dec 2022
Why reinvent the wheel? magic_enum
Macro to write enum and converter from and to string
2 projects | /r/cpp_questions | 26 Oct 2022
I strongly recommend that you instead use magic_enum::enum_cast2 projects | /r/cpp_questions | 26 Oct 2022
Magic Enum provides that.
New to Programming and Would Like a Code Review or Tips on Readability
3 projects | /r/cpp_questions | 15 Oct 2022
While I can understand the sentiment behind that it makes for a poor solution because people seeing the enum will assume it's a valid entry. A better solution is to use something like magic enum for that case.
What are some cool modern libraries you enjoy using?
32 projects | /r/cpp | 18 Sep 2022
magic_enum by far. It has an extreme amount of black magic, and compiler specific stuff all abstracted away behind its extremely neat user interface.
what annoys you most while using c++?
5 projects | /r/cpp | 28 Aug 2022
Show HN: The Ultimate C++14 Enum Library
2 projects | news.ycombinator.com | 26 Jul 2022
To my knowledge magic_enum has some severe limitations; for example, it limits the range of enum values, it cannot handle duplicate enum values, it uses compiler-specific hackes, etc. There is a list of all of them here. 
And I'm glad to see interest! I can definitely add string -> enum conversion—I'll see if I can do that right now in fact, it might not take long.
which concerns of the game dev industry does the committee NOT address ?
8 projects | /r/cpp | 22 Jun 2022
It also has really cruel limitations, defaulting to MAGIC_ENUM_RANGE_MAX = 128! It will quietly fail if you try to use this with Vulkan enums for example.
What are some alternatives?
Nameof C++ - Nameof operator for modern C++, simply obtain the name of a variable, type, function, macro, and enum
Protobuf - Protocol Buffers - Google's data interchange format
cereal - A C++11 library for serialization
FlatBuffers - FlatBuffers: Memory Efficient Serialization Library
Boost.Serialization - Boost.org serialization module
pfr - std::tuple like methods for user defined types without any macro or boilerplate code
rttr - C++ Reflection Library
Bitsery - Your binary serialization library
cppbor - An implementation of cbor using C++ 17 variants
protozero - Minimalist protocol buffer decoder and encoder in C++
wise_enum - A reflective enum implementation for C++
MessagePack - MessagePack implementation for C and C++ / msgpack.org[C/C++]