Is there a way to check (assert) at compile time wether a const char* contains spaces or not?
Something like:
const char* cstr1 = "ok";
const char* cstr2 = "very bad";
check( cstr1 ); //OK
check( cstr2 ); //Fail to compile
The type is the same, but it may be possible to define some tricky template metaprogramming tecnique to do it.
Point is, all the info required is fixed at compile time.
This problem should be related to the "From const char variable to type" problem, which I think can be solved by compile-time hashing via metaprogramming tecniques.
Thank you in advance for your help.