Boost logo

Boost Users :

Subject: Re: [Boost-users] Unwanted implicit conversions to bool
From: Thorsten Ottosen (thorsten.ottosen_at_[hidden])
Date: 2011-05-12 10:41:20


Den 12-05-2011 12:58, Dominik Steenken skrev:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> inline std::size_t hash_value(boost::shared_ptr<const IHashable> obj)
> {
> return obj->hash_value();
> }
>

Remark: always write

   foo( const boost::shared_ptr<T>& obj)

to avoid needless update of the ref count/weak count.

-Thorsten


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