I've been looking for this for quite a while, and I maybe I just don't know what words to use to find it.
I have a template class that accepts a type, and would like the constructor to be different depending on if that type is a pointer or not. Here is some code to explain what I mean.
template <class T> class Example
{
bool choice;
public:
//Only if T is not a pointer type
Example() : choice{false}
{}
//Only if T is a pointer type
Example(bool choice) : choice{choice}
{}
}
I have experimented with std::enable_if and std::is_pointer<T> but with no luck.