Prev: Does the C++ standard define the global function of " istream& operator >>(istream& in, string& str); "?
Next: return value optimization vs. returning a boost::shared_ptr of container
From: Thomas Maeder on 14 Jun 2010 18:14 "naikrosh(a)gmail.com" <naikrosh(a)gmail.com> writes: > Is there a safe way to treat Foo<T>* as a Foo<const T>* ? > > template<class T> > struct Foo { > T* ptr; > bool flag; > ~Foo(){}; // This makes Foo ... not a POD type > }; What you ask for looks suspiciously like converting from T** to T const **. Cf. http://c-faq.com/ansi/constmismatch.html --- news://freenews.netfront.net/ - complaints: news(a)netfront.net --- -- [ See http://www.gotw.ca/resources/clcm.htm for info about ] [ comp.lang.c++.moderated. First time posters: Do this! ] |