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
>   case foo: break;
>        ^
> note: ‘foo’ was not declared ‘constexpr’
>  const static OIIO::ustring foo("foo");
_______________________________________________
Oiio-dev mailing list
[email protected]
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org

Reply via email to