Created
February 15, 2019 02:05
-
-
Save cppio/476b820516b9e76be1185fb3f00512f5 to your computer and use it in GitHub Desktop.
Simple C++ class that logs all constructions, destructions, and assignments.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
class Test { | |
public: | |
Test() { std::cout << __PRETTY_FUNCTION__ << std::endl; } | |
Test(Test const&) { std::cout << __PRETTY_FUNCTION__ << std::endl; } | |
Test(Test&&) { std::cout << __PRETTY_FUNCTION__ << std::endl; } | |
~Test() { std::cout << __PRETTY_FUNCTION__ << std::endl; } | |
Test& operator=(Test const&) { std::cout << __PRETTY_FUNCTION__ << std::endl; return *this; } | |
Test& operator=(Test&&) { std::cout << __PRETTY_FUNCTION__ << std::endl; return *this; } | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment