ID, a compile-time string hasher and sequential ID generator (C++11).
- Based on code by Stefan 'Tivolo' Reinalter.
- Tiny, header-only, cross-platform.
- No dependencies.
- ZLIB/LibPNG licensed.
- Modern C++11 compiler required, or optimizations enabled at least.
#include <iostream>
#include "id.hpp"
int main() {
// generate compile-time hash ids
std::cout << $id("HELLO_WORLD") << std::endl;
std::cout << $id("PLAYER_1") << std::endl;
// generate sequential ids
std::cout << $id() << std::endl;
std::cout << $id() << std::endl;
// resetting sequential generator is allowed
$id() = 0;
std::cout << $id() << std::endl;
}
- v1.0.0 (2015/10/01)
- Semantic versioning adherence