C++相談室 part61
at TECH
615:デフォルトの名無しさん
08/04/18 11:03:18
>>611
make_reverse_range(src) // boost::range_ex
src|reversed // pstade::oven
非標準のライブラリ使ってもいいならこんな感じで簡単に書ける
>>612
HogePtrをtemplateにして
template template parameterでboost::shared_ptr等を与える
// hoge.h
struct Hoge { ... };
template< template<typename T> class Pointer >
struct HogePtr {
typedef Pointer<Hoge> type;
};
// client code
#include "hoge.h"
template< typename T > struct raw_pointer { typedef T *type; };
HogePtr<raw_ptr> raw;
#include <boost/shared_ptr.hpp>
HogePtr<boost::shared_ptr> shared;
これならhoge.hppで#includeしなくてもよくなる筈
次ページ続きを表示1を表示最新レス表示スレッドの検索類似スレ一覧話題のニュースおまかせリスト▼オプションを表示暇つぶし2ch
4586日前に更新/200 KB
担当:undef