Boost logo

Boost Users :

Subject: Re: [Boost-users] TR1 unordered_set: compilation failure with initialization
From: Aman Sinha (aman.sinha_at_[hidden])
Date: 2010-02-28 11:17:34


Thanks, that was the problem. It would be a useful extension to the interface to choose a default minimum hash buckets if the caller only specifies the hasher.

Aman

-----Original Message-----
From: boost-users-bounces_at_[hidden] [mailto:boost-users-bounces_at_[hidden]] On Behalf Of Daniel James
Sent: Saturday, February 27, 2010 4:37 PM
To: boost-users_at_[hidden]
Subject: Re: [Boost-users] TR1 unordered_set: compilation failure with initialization

On 27 February 2010 23:42, Aman Sinha <aman.sinha_at_[hidden]> wrote:
> I want to pass in my own hash functor and comparator to an unordered_set
> initialization.   It fails compilation on g++ 4.2.1,  boost version 1.42.
> It's not clear why, since a similar initialization of an STL  set container
> seems to work fine. see below for the code and compilation failure.  Any
> insight would be highly appreciated.

There isn't a matching constructor (I have no idea why). You need to
give a minimum initial number of buckets, something like:

m_unordered_set(10, foo_hash1(), foo_compare(is_gt))

Daniel
_______________________________________________
Boost-users mailing list
Boost-users_at_[hidden]
http://lists.boost.org/mailman/listinfo.cgi/boost-users


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