Added support for jlcxx::Val<T>, which works nearly identically as jlcxx::SingletonType<T>.
All types supported by jlcxx::box should also work with Val<T>.
A separate specialization using std::string_view is used to support symbols too. Because C++ forbids strings of any kind in templates, we are forced to use a static constexpr const std::string_view to be able to use it as a template parameter. Since the type is a bit convoluted, I added the JLCXX_VAL_SYM macro to simplify the symbol declaration.
Using a const char[] would have also been possible, but JLCXX_VAL_SYM would get a bit weirder to use, hence the std::string_view.
Added support for
jlcxx::Val<T>
, which works nearly identically asjlcxx::SingletonType<T>
. All types supported byjlcxx::box
should also work withVal<T>
.A separate specialization using
std::string_view
is used to support symbols too. Because C++ forbids strings of any kind in templates, we are forced to use astatic constexpr const std::string_view
to be able to use it as a template parameter. Since the type is a bit convoluted, I added theJLCXX_VAL_SYM
macro to simplify the symbol declaration. Using aconst char[]
would have also been possible, butJLCXX_VAL_SYM
would get a bit weirder to use, hence thestd::string_view
.