I wrote the following code to determine if a type is an instantiation of std::basic_string:
template <typename T>
struct is_string
{
enum { value = false };
};
template <typename charT, typename traits, typename Alloc>
struct is_string<std::basic_string<charT, traits, Alloc> >
{
enum { value = true };
};
Is there a more succinct way to achieve that?
Okay, I found a slightly shorter way:
But maybe others can do even better? 🙂