Created
January 29, 2013 23:15
-
-
Save siritori/4668917 to your computer and use it in GitHub Desktop.
なんでエラーでるんー
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> | |
#include <list> | |
#include <memory> | |
class hoge; | |
typedef std::shared_ptr<hoge> hoge_ptr; | |
class hoge | |
{ | |
public: | |
hoge(const int x):x_(x) | |
{ | |
hoges.push_back(hoge_ptr(this)); | |
} | |
private: | |
int x_; | |
static std::list<hoge_ptr> hoges; | |
}; | |
std::list<hoge_ptr> hoge::hoges; | |
int main() | |
{ | |
hoge x(5); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment