#include <iostream>
#include<map>
#include<string>
#include<vector>
#include <type_traits>
using namespace std;
template<typename Iterator>
class Test
{
public :
typedef Iterator it;
Test() :
_current(Iterator()) {std::cout<<"default ctor"<<std::endl;}
Test(const Test& x) :
_current(x.getCurrent()) {std::cout<<"non template copy ctor"<<std::endl;}
template<typename Iter, std::enable_if_t<std::is_same_v<Iterator, Iter>>>
Test(const Test<Iter>& x) :
_current(x.getCurrent()) {std::cout<<"template ctor"<<std::endl;}
~Test() {std::cout<<"dtor"<<std::endl;}
it&
getCurrent() const { return this->_current; }
private :
Iterator _current;
};
int main()
{
Test<const int> test1;
// Test<int> test2(test1); //wont work
Test<const int> test3(test1); //works
return 0;
}