You will need to implement the correct hashing algorithm, but this can work using constexpr C ++ 11 functions:
#include <iostream>
constexpr unsigned compile_time_hash(const char* str) {
return (*str == 0) ? 0 : (*str + compile_time_hash(str + 1));
}
int main() {
unsigned some_hash = compile_time_hash("hallou");
std::cout << some_hash << std::endl;
}
ResourcesManager::get, compile_time_hash ( ).
, , , . - SHA * constexpr .
, constexpr GCC >= 4.6 clang >= 3.1.