|
Boost Users : |
Subject: Re: [Boost-users] TR1 unordered_set: compilation failure with initialization
From: Daniel James (dnljms_at_[hidden])
Date: 2010-02-27 19:36:37
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.
> Its 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 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