Søren Ragsdale
2018-10-12 10:53:54 UTC
Is there any way to use an OIIO::ustring in a switch statement? I'm
guessing that it's not possible because the hashes for these strings are
generated at compile time.
const static OIIO::ustring foo("foo");
const static OIIO::ustring bar("bar");
switch (foo) {
case foo: break;
case bar: break;
default: break;
}
error: the value of âfooâ is not usable in a constant expression
guessing that it's not possible because the hashes for these strings are
generated at compile time.
const static OIIO::ustring foo("foo");
const static OIIO::ustring bar("bar");
switch (foo) {
case foo: break;
case bar: break;
default: break;
}
error: the value of âfooâ is not usable in a constant expression
case foo: break;
^
note: âfooâ was not declared âconstexprâ
const static OIIO::ustring foo("foo");
^
note: âfooâ was not declared âconstexprâ
const static OIIO::ustring foo("foo");