i have library uses library b. want user of use templated class b library. , b have different namespaces, possible encapsulate/hide class b in namespace?
i tried use pimpl ... it's template, don't know how can it.
for reference class want encapsulate in library is:
namespace anax { template <typename t> class component : public basecomponent { public: static detail::typeid gettypeid() { return detail::classtypeid<basecomponent>::gettypeid<t>(); } }; }
so users of a, have example:
class position: public anax::component<position> { float x,y,z; }
what i'm asking if it's possible encapsulate/hide anax::component class inside namespace this:
class position: public myanamespace::component<position> { float x,y,z; }
how about:
namespace myanamespace{ template<class position> using component = anax::component<position>; }
or, in pre-c++11,
namespace myanamespace{ template<class position> struct component { typedef anax::component<position> type; }; }
Comments
Post a Comment