online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include <iostream> #include <vector> class Test { public: Test() { std::cout << ">>>> Test constructor called\n"; } Test(const Test&) { std::cout << ">>>> Test copy constructor called\n"; } Test(Test&&) { std::cout << ">>>> Test move constructor called\n"; } ~Test() { std::cout << "<<<< Test destructor called\n"; } }; int main() { // scope to manage life cycle of vec1 { std::cout << "\nCreating first vector (push_back)\n"; std::vector<Test> vec1; vec1.push_back(Test{}); std::cout << "Destroying first vector\n"; } // scope to manage life cycle of vec2 { std::cout << "\nCreating second vector (emplace_back)\n"; std::vector<Test> vec2; vec2.emplace_back(); std::cout << "Destroying second vector\n"; } 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