{"author_name":"faith_and_brave","height":"190","image_url":null,"description":"\u4ee5\u4e0b\u306e4\u3064\u3067\u3059\u3002 #include <iostream> #include <vector> #include <algorithm> template <class T> class smart_ptr { T* p_; public: smart_ptr() : p_(0) {} explicit operator bool() const // 1.\u660e\u793a\u7684\u306a\u578b\u5909\u63db\u6f14\u7b97\u5b50 { return p_ != 0; } }; int main() { smart_ptr<int> p; if (p) {} // int x = p + 1; // NG const std::vector<int>\u2026","published":"2010-03-09 16:22:51","blog_url":"https://faithandbrave.hateblo.jp/","provider_url":"https://hatena.blog","author_url":"https://blog.hatena.ne.jp/faith_and_brave/","title":" GCC 4.5\u304b\u3089\u4f7f\u7528\u53ef\u80fd\u306aC++0x\u6a5f\u80fd","provider_name":"Hatena Blog","type":"rich","version":"1.0","width":"100%","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Ffaithandbrave.hateblo.jp%2Fentry%2F20100309%2F1268119371\" title=\" GCC 4.5\u304b\u3089\u4f7f\u7528\u53ef\u80fd\u306aC++0x\u6a5f\u80fd - Faith and Brave - C++\u3067\u904a\u307c\u3046\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","url":"https://faithandbrave.hateblo.jp/entry/20100309/1268119371","categories":["GCC","C++"],"blog_title":"Faith and Brave - C++\u3067\u904a\u307c\u3046"}