online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#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; }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue