template typedef" idiom:
#if HAVE_STD_TR1_SHARED_PTR
template <class T>
struct SharedPtr {
typedef std::tr1::shared_ptr<T> Type;
};
#elif HAVE_BOOST_SHARED_PTR
template <class T>
struct SharedPtr {
typedef boost::shared_ptr<T> Type;
};
#else
# error "No definition for shared_ptr found"
#endif
SharedPtr<int>::Type my_shared_int(new int(42));
:: Type. , ++ typedef . typedef instance, .
TR1 Boost, "". , ++ 0x, , std:: shared_ptr .
typedef, shared_ptr, - . , ++, , - , , slist ++ . g++ , g++ __gnu_cxx , , std!