|
Boost Users : |
From: Noel Yap (noel.yap_at_[hidden])
Date: 2005-11-14 16:56:54
Have you tried:
typename pointer<T>::arr some_stuff;
On 11/14/05, Doug Henry <brilligent_at_[hidden]> wrote:
> I have been attempting to hide the boost interface when using the boost
> smart pointers. I basically want to get rid of boost declarations in my
> API's. This basically involves typedef-ing template classes, and the best
> solution I have been able to come up with is:
>
> template <typename T>
> struct pointer
> {
> typedef boost::scoped_ptr<T> obj;
> typedef boost::scoped_array<T> arr;
> typedef boost::shared_ptr<T> sobj;
> typedef boost::shared_array<T> sarr;
> };
>
> so I can do things like pointer<int>::arr var(new int[10]). This works
> fine, but if I try to get tricky it falls apart. Another example:
>
> template <typename T>
> class Stuff
> {
> private:
> pointer<T>::arr some_stuff;
> };
>
> This does not work (I can't even start to tell you why), but I have hit the
> point where I have to start second guessing my approach to this problem.
> Are there other (possibly terrible) tricks to get around the typedef
> templates problem? Any input will probably help.
>
> -thanks
>
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>
>
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net