Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mute124/true-enum
True Enum is a simple header-only library designed for easy enumeration of variables or objects that can be implemented in only one line of code. It is extremely customizable to the point of being able to cap it's memory usage!
https://github.com/mute124/true-enum
cpp customization easy-to-use enumeration example-code fast fastapi header header-only header-only-library lightweight lite modular
Last synced: about 1 month ago
JSON representation
True Enum is a simple header-only library designed for easy enumeration of variables or objects that can be implemented in only one line of code. It is extremely customizable to the point of being able to cap it's memory usage!
- Host: GitHub
- URL: https://github.com/mute124/true-enum
- Owner: Mute124
- Created: 2024-04-28T13:13:02.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-05-11T15:34:04.000Z (8 months ago)
- Last Synced: 2024-05-11T16:34:54.681Z (8 months ago)
- Topics: cpp, customization, easy-to-use, enumeration, example-code, fast, fastapi, header, header-only, header-only-library, lightweight, lite, modular
- Language: C++
- Homepage:
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## True Enum
## About
True enum is a fast header only library that aims to make enumerating easy to do! But do not think it is stuck in it's ways, almost every aspect of it can be customized to your needs, an example of which is limiting it's memory usage!This library was made for my personal game engine project, Techstorm. It all started when I had an idea "What if Enums could be made during runtime?", and then I decided to try to add that to Techstorm and that is how I ended up making this.
## Key Features
- Type Enumeration
- Provide an alias for variables
- Setting and Getting
- Reading/Writing to a file
- Allocating memory to True-Enum
- Memory capping
- Modularity
- Certain features can be turned on and off via a simple preproccessing define.## Getting started
Since this is header-only, you dont need to do a thing at all. Here are two ways you can start using True-Enum.#include "TrueEnum.h"
void YourFunction() {
...
TrueEnum::TrueEnumStr enumerator;
...
}Yup, thats all! a single line of code is all you need to get started. If you want to use something other than a string as the alias, use the example below,
#include "TrueEnum.h"
void YourFunction() {
...
TrueEnum::ITrueEnum enumerator;
...
}Replace the int with what ever type you need!
## How to help
If you feel we are missing something, please feel free to go and make a change! The only way this gets better is if you help, so be my guest!