Boost logo

Boost Users :

Subject: Re: [Boost-users] [hash] hashing of smart pointer types - prevent conversion to bool?
From: Alastair Rankine (arsptr_at_[hidden])
Date: 2010-07-07 07:50:24


On 2010-07-07 09:01:32 +1000, Daniel James said:

> On 6 July 2010 13:15, Alastair Rankine <arsptr_at_[hidden]> wrote:
>>
>> I'm sure I'm not the first person to be caught out by this.
>
> You're the first person to report it.

Maybe everyone else who is hashing smart pointers isn't willing to own
up to it? :)

> It won't happen for a 'std' or 'std::tr1' implementation, as this
> issue is caused by the boost extensions to the standard. It also won't
> happen in boost if you disable the extensions by defining
> 'BOOST_HASH_NO_EXTENSIONS'.

Ah good, that will probably work nicely for me. Thanks.

> I do actually view this as a bug. Of the top of my header, I can think
> of a few possible fixes:

FWIW I like option 2 but I'm happy with any of these fixes. Look
forward to seeing this in an upcoming boost, if not the next one.

Thanks for your response.


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