2012-08-09から1日間の記事一覧

C++ で新潟

C++

いわゆる読めるけど書けないメンバ変数。 ちょっと書いてみた。 [ソース] #include <iostream> #include <type_traits> #include <string> template<typename Class, typename Type, Type Class::*PtrToMember> struct property{ property(Class& self) : self(self){} operator Type const&() const{ return get(); } Type const& get() const{ return</typename></string></type_traits></iostream>…