SL-16094: Support ll_convert<std::string>(const char*)

and correspondingly, ll_convert<std::wstring>(const wchar_t*).

Now that we're using ll_convert() for single-argument stringize(arg), make
sure it can efficiently handle the simple case of constructing a string from a
const char pointer.
master
Nat Goodspeed 2021-11-23 14:25:16 -05:00
parent adc2666dbb
commit 30cf50e6af
1 changed files with 7 additions and 0 deletions

View File

@ -529,6 +529,13 @@ struct ll_convert_impl<T, T>
T operator()(const T& in) const { return in; }
};
// simple construction from char*
template<typename T>
struct ll_convert_impl<T, const typename T::value_type*>
{
T operator()(const typename T::value_type* in) const { return { in }; }
};
// specialize ll_convert_impl<TO, FROM> to return EXPR
#define ll_convert_alias(TO, FROM, EXPR) \
template<> \