ldionne / dyno

Runtime polymorphism done right
Boost Software License 1.0
971 stars 42 forks source link

Selectors accept actual compile-time strings #41

Open ldionne opened 6 years ago

ldionne commented 6 years ago

It is possible to forego the decltype step when using selectors, giving:

dyno::only<"foo"_s, "bar"_s>

instead of

dyno::only<decltype("foo"_s), decltype("bar"_s)>

To do this, we only need to add an implicit conversion to char const* to the literal type created by the _s literal. live example. Unfortunately, this is not supported by GCC 7, which is the only compiler I have locally that can actually build Dyno. So I'll wait a bit before making the change.