Last active
December 27, 2015 17:59
-
-
Save toulouse/7366897 to your computer and use it in GitHub Desktop.
This file contains 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 BlahClass { | |
public: | |
BlahClass() { | |
std::cout << "BlahClass()" << std::endl; | |
} | |
~BlahClass() { | |
std::cout << "~BlahClass()" << std::endl; | |
} | |
}; | |
__attribute__((constructor)) | |
void makeStaticBlah() { | |
std::cout << "makeStaticBlah()" << std::endl; | |
static BlahClass b; | |
} | |
int main(int argc, const char * argv[]) | |
{ | |
std::cout << "Begin" << std::endl; | |
std::cout << "End" << std::endl; | |
return 0; | |
} | |
This file contains 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
makeStaticBlah() | |
BlahClass() | |
Begin | |
End | |
~BlahClass() | |
Program ended with exit code: 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment