I am trying to implement a std::list-like doubly linked list and in a template constructor I need to restrict the type that would be used.
So after a couple of google searches, I came across the topic SFINAE which until today I had never heard of it. Even though I haven't fully understood it yet but I have the essential idea of how it works, and when it is used.
Which brings me to my question: I need to make sure that the template parameter is an iterator, something that I can't seem to figure it out on my own how to do.
I know that I will be using
, but I don't understand how exactly I am going to use it(I saw some examples on my google searches and its syntax looked quite difficult to get a grasp on).
This is the stripped down version of my code that is meant to highlight only the part where I have the question about.
template <typename T>
template<typename InputIt, typename = typename td::enable_if_t<> > //this is where I am stuck
List(InputIt first, InputIt last);
So, if someone could shine a light on this issue for me I would very much appreciate it.
Also, a bonus question: What's with the
, what exactly are they and what they are for?