I don't know what you are doing and I am not an expert at meta template programming, but to create an interface which blends string and wstring and any string type together is to use something like this:
std::basic_string< char, std::char_traits< char>>
and swap out char with whatever you want, and wstring is simply this but with wchar_t.
Is it possible to test the type of any arbitrary element in the variadic pack in a function such as provided above?
I would like to create specializations of the function jdto_string based on the type of the nth template parameter.
It may sound useless - but it's an exercise.
The easiest way to index a parameter pack is to build a tuple out of it and call std::tuple_element on it.
However, types in the pack probably need to have their reference-ness and cv-qualifications stripped before you can compare them easily. You could do that explicitly with a combination of remove_reference and remove_cv, or decay if you're not dealing with function or array types; or preferably C++20's remove_cvref.
Couldn't you strip off the first type in the usual way?
Yeah, but in his second post @Juan Dent says he wants the type of an arbitrary element in the pack.
BTW, what's the difference between enable_if and enable_if_t?
Standard library meta-functions with a _t suffix are just type aliases for the member type named metafunction::type. For instance, std::enable_if_t is something like