From 2d488eeb96904bac9cd0077cc8a438597826ed41 Mon Sep 17 00:00:00 2001 From: Michael Andres Date: Mon, 14 Nov 2005 22:57:33 +0000 Subject: [PATCH] gcc refuses to use scoped_ptr on incomplete type, so let ImplPtr default to use a shared_ptr. Will waste a refcount per Resolvable. --- zypp/base/PtrTypes.h | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/zypp/base/PtrTypes.h b/zypp/base/PtrTypes.h index c87699e..8937ca2 100644 --- a/zypp/base/PtrTypes.h +++ b/zypp/base/PtrTypes.h @@ -70,11 +70,33 @@ namespace zypp * nonconst implementation methods. In case you have to do so, call * unconst to get the _D *. * - * The second template argument defaults to _Ptr = scoped_ptr<_D>. + * The second template argument defaults to _Ptr = shared__ptr<_D>. * * \todo refine ctor and assign. + * \todo check whether scoped_ptr's refusal to handle an incomplete type + * is a compiler bug. Introducing ~CI does not help, although I is complete + * when ~CI is called. This renders scoped_ptr less usefull. + * \code + * #include + * struct I; + * struct CI + * { + * ~CI(); + * private: + * zypp::base::scoped_ptr i; + * }; + * int main( int argc, char * argv[] ) + * { + * CI c; + * return 0; + * } + * struct I {}; + * CI::~CI() + * { + * } + * \endcode */ - template > + template > struct ImplPtr { typedef _D element_type; -- 2.7.4