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@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Daniel James
Sent: Saturday, February 27, 2010 4:37 PM
To: boost-users@lists.boost.org
Subject: Re: [Boost-users] TR1 unordered_set: compilation failure with initialization
On 27 February 2010 23:42, Aman Sinha
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@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users