Typedef to change the name shared_ptr?
Hello, Is there some way I can abbreviate the name shared_ptr? I make extensive use of it, and my code tends to be ugly... vector
v;
would be much better than
vector
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, you can do the following: typedef boost::shared_ptr<int> tPtrInt; vector<tPtrInt> v; Michael On Thursday 03 April 2003 11:04, Maurizio Colucci wrote:
Hello,
Is there some way I can abbreviate the name shared_ptr? I make extensive use of it, and my code tends to be ugly...
vector
v;
would be much better than
vector
v; is something like
typedef shared_ptr p;
possible?
Thanks,
Maurizio
Info: http://www.boost.org Wiki: http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl Unsubscribe: mailto:boost-users-unsubscribe@yahoogroups.com
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
- -- Dipl.-Ing. Michael Kettner, Wissenschaftlicher Mitarbeiter Institut für Verkehrswesen, Eisenbahnbau und -betrieb, Universitaet Hannover Appelstr. 9A # Tel: ++49/(0)511/762-4273 D-30167 Hannover # Fax: ++49/(0)511/762-3001 http://www.ive.uni-hannover.de # kettner@ive.uni-hannover.de -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE+jA0xkCdGnb0kVFMRAkujAJ9nuaBNWWA0u0YF5jUi9/BlVC5m6wCePHF+ eO9/hWhyAepA+wOJXfZ7k1w= =2Rzp -----END PGP SIGNATURE-----
On Thursday 03 April 2003 12:30, Michael Kettner wrote:
you can do the following:
typedef boost::shared_ptr<int> tPtrInt;
vector<tPtrInt> v;
Michael
Thanks Michael. So there is no way to rename shared_ptr once and for all, right? (I'm asking because I have heard about "template typedefs", but I don't know the syntax.) cheers, Maurizio
"template typedef" is a feature-to-be , essentially
it's something that would do exactly as you suggest,
but is not currently in the language, but is likely to
be added in the next language revision..
see herb sutter's gotw article for possible options..
http://www.gotw.ca/gotw/079.htm
--vat
--- Maurizio Colucci
On Thursday 03 April 2003 12:30, Michael Kettner wrote:
you can do the following:
typedef boost::shared_ptr<int> tPtrInt;
vector<tPtrInt> v;
Michael
Thanks Michael.
So there is no way to rename shared_ptr once and for all, right?
(I'm asking because I have heard about "template typedefs", but I don't know the syntax.)
cheers,
Maurizio
__________________________________________________ Do you Yahoo!? Yahoo! Tax Center - File online, calculators, forms, and more http://tax.yahoo.com
participants (3)
-
Maurizio Colucci
-
Michael Kettner
-
srivatsan raghavan