depreciated iterator warnings with gcc

Hi, I have a simple collection template that uses boost::shared_ptr and std::list. I have used this with Borland Builder 5/6 for sometime now with no problems. I am moving some code that uses the template to GCC(3.2.3) and have found that this is giving me some depreciation warnings. A snip of my template(coll.h): template <class T> class Collection { private: list < shared_ptr<T> > items; list < shared_ptr<T> >::iterator iter; ... }; And the errors: coll.h:106: warning: `typename std::list<boost::shared_ptr<T>, std::allocator<boost::shared_ptr<T> > >::iterator' is implicitly a typename coll.h:106: warning: implicit typename is deprecated, please see the documentation for details coll.h:107: warning: `typename std::list<boost::shared_ptr<T>, std::allocator<boost::shared_ptr<T> > >::iterator' is implicitly a typename coll.h:107: warning: implicit typename is deprecated, please see the documentation for details Is there a different method that I need to use for GCC? Thanks, Chris

"Chris Garrett" <cgarrett@degarrah.com> wrote in message news:4065D5E8.8000200@degarrah.com...
Hi,
I have a simple collection template that uses boost::shared_ptr and std::list. I have used this with Borland Builder 5/6 for sometime now with no problems. I am moving some code that uses the template to GCC(3.2.3) and have found that this is giving me some depreciation warnings.
A snip of my template(coll.h):
template <class T> class Collection { private: list < shared_ptr<T> > items; list < shared_ptr<T> >::iterator iter;
you need 'typename' before 'list < shared_ptr<T> >::iterator' here.
... };
Also, it's 'deprecated', not 'depreciated' :-) Jonathan

Excellent thanks very much! Chris Jonathan Turkanis wrote:
"Chris Garrett" <cgarrett@degarrah.com> wrote in message news:4065D5E8.8000200@degarrah.com...
Hi,
I have a simple collection template that uses boost::shared_ptr and std::list. I have used this with Borland Builder 5/6 for sometime
now
with no problems. I am moving some code that uses the template to GCC(3.2.3) and have found that this is giving me some depreciation warnings.
A snip of my template(coll.h):
template <class T> class Collection { private: list < shared_ptr<T> > items; list < shared_ptr<T> >::iterator iter;
you need 'typename' before 'list < shared_ptr<T> >::iterator' here.
... };
Also, it's 'deprecated', not 'depreciated' :-)
Jonathan
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
participants (2)
-
Chris Garrett
-
Jonathan Turkanis