|
Boost Users : |
From: Andrej van der Zee (mavdzee_at_[hidden])
Date: 2007-06-14 13:09:36
Hi,
I have a problem with a hash-index to a member of type
std::vector<std::strings>. With boost 1.34 it compiles
and runs find, but it fails to compile with 1.33!
Unfortunately I do not have the luxury to change
boost-version. Is there any way around this?
I defined my multi_index_container like this:
typedef std::vector<std::string> keys_type;
struct entry_type
{
keys_type keys;
bool operator<(const entry_type& e) const
{ ... }
};
typedef boost::multi_index::multi_index_container<
entry_type,
mi::indexed_by<
mi::hashed_unique<
mi::tag<hash_index_tag>,
mi::member<entry_type, keys_type,
&entry_type::keys> >,
mi::ordered_non_unique<
mi::tag<pred_index_tag>,
mi::identity<entry_type> >
>
> mi_entries_type;
And get the following compile-error (see the bottom):
/usr/bin/g++ -m64 -pipe -Wall -fPIC -O3 -DNDEBUG
-I../framework
-I/sitestat/src/nightly/2007-06-14/branches/rel-6-00/src/build/../../src/cgi
-I/sitestat/src/nightly/2007-06-14/branches/rel-6-00/src/build/../../src/zip_utils
-DBOOST_SP_USE_QUICK_ALLOCATOR -DBOOST_DISABLE_THREADS
-m64 -pipe -Wall -fPIC -O3 -DNDEBUG -c refper_key.cpp
-o release/refper_key.o
refper_key.cpp: In member function virtual
repgen::operator_base::error_code
repgen::refper_key::do_pre_eval():
refper_key.cpp:391: warning: unused variable cols
/usr/include/boost/functional/hash/hash.hpp: In static
member function static size_t
boost::hash_detail::call_hash<T>::call(const T&) [with
T = std::vector<std::basic_string<char,
std::char_traits<char>, std::allocator<char> >,
std::allocator<std::basic_string<char,
std::char_traits<char>, std::allocator<char> > > >]:
/usr/include/boost/functional/hash/hash.hpp:315:
instantiated from size_t
boost::hash<T>::operator()(const T&) const [with T =
std::vector<std::basic_string<char,
std::char_traits<char>, std::allocator<char> >,
std::allocator<std::basic_string<char,
std::char_traits<char>, std::allocator<char> > > >]
/usr/include/boost/multi_index/hashed_index.hpp:372:
instantiated from
boost::multi_index::detail::hashed_index_iterator<boost::multi_index::detail::hashed_index_node<typename
SuperMeta::type::node_type>,
boost::multi_index::detail::bucket_array<typename
SuperMeta::type::final_allocator_type> >
boost::multi_index::detail::hashed_index<KeyFromValue,
Hash, Pred, SuperMeta, TagList, Category>::find(const
CompatibleKey&, const CompatibleHash&, const
CompatiblePred&) const [with CompatibleKey =
std::vector<std::basic_string<char,
std::char_traits<char>, std::allocator<char> >,
std::allocator<std::basic_string<char,
std::char_traits<char>, std::allocator<char> > > >,
CompatibleHash =
boost::hash<std::vector<std::basic_string<char,
std::char_traits<char>, std::allocator<char> >,
std::allocator<std::basic_string<char,
std::char_traits<char>, std::allocator<char> > > > >,
CompatiblePred =
std::equal_to<std::vector<std::basic_string<char,
std::char_traits<char>, std::allocator<char> >,
std::allocator<std::basic_string<char,
std::char_traits<char>, std::allocator<char> > > > >,
KeyFromValue =
boost::multi_index::member<repgen::refper_types::entry_type,
std::vector<std::basic_string<char,
std::char_traits<char>, std::allocator<char> >,
std::allocator<std::basic_string<char,
std::char_traits<char>, std::allocator<char> > > >,
&repgen::refper_types::entry_type::keys>, Hash =
boost::hash<std::vector<std::basic_string<char,
std::char_traits<char>, std::allocator<char> >,
std::allocator<std::basic_string<char,
std::char_traits<char>, std::allocator<char> > > > >,
Pred =
std::equal_to<std::vector<std::basic_string<char,
std::char_traits<char>, std::allocator<char> >,
std::allocator<std::basic_string<char,
std::char_traits<char>, std::allocator<char> > > > >,
SuperMeta = boost::multi_index::detail::nth_layer<1,
repgen::refper_types::entry_type,
boost::multi_index::indexed_by<boost::multi_index::hashed_unique<boost::multi_index::tag<repgen::refper_types::hash_index_tag,
mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
mpl_::na, mpl_::na, mpl_::na, mpl_::na>,
boost::multi_index::member<repgen::refper_types::entry_type,
std::vector<std::basic_string<char,
std::char_traits<char>, std::allocator<char> >,
std::allocator<std::basic_string<char,
std::char_traits<char>, std::allocator<char> > > >,
&repgen::refper_types::entry_type::keys>, mpl_::na,
mpl_::na>,
boost::multi_index::ordered_non_unique<boost::multi_index::tag<repgen::refper_types::pred_index_tag,
mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
mpl_::na, mpl_::na, mpl_::na, mpl_::na>,
boost::multi_index::identity<repgen::refper_types::entry_type>,
mpl_::na>, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
mpl_::na, mpl_::na, mpl_::na, mpl_::na>,
std::allocator<repgen::refper_types::entry_type> >,
TagList =
boost::mpl::v_item<repgen::refper_types::hash_index_tag,
boost::mpl::vector0<mpl_::na>, 0>, Category =
boost::multi_index::detail::hashed_unique_tag]
/usr/include/boost/multi_index/hashed_index.hpp:362:
instantiated from
boost::multi_index::detail::hashed_index_iterator<boost::multi_index::detail::hashed_index_node<typename
SuperMeta::type::node_type>,
boost::multi_index::detail::bucket_array<typename
SuperMeta::type::final_allocator_type> >
boost::multi_index::detail::hashed_index<KeyFromValue,
Hash, Pred, SuperMeta, TagList, Category>::find(const
CompatibleKey&) const [with CompatibleKey =
repgen::refper_types::keys_type, KeyFromValue =
boost::multi_index::member<repgen::refper_types::entry_type,
std::vector<std::basic_string<char,
std::char_traits<char>, std::allocator<char> >,
std::allocator<std::basic_string<char,
std::char_traits<char>, std::allocator<char> > > >,
&repgen::refper_types::entry_type::keys>, Hash =
boost::hash<std::vector<std::basic_string<char,
std::char_traits<char>, std::allocator<char> >,
std::allocator<std::basic_string<char,
std::char_traits<char>, std::allocator<char> > > > >,
Pred =
std::equal_to<std::vector<std::basic_string<char,
std::char_traits<char>, std::allocator<char> >,
std::allocator<std::basic_string<char,
std::char_traits<char>, std::allocator<char> > > > >,
SuperMeta = boost::multi_index::detail::nth_layer<1,
repgen::refper_types::entry_type,
boost::multi_index::indexed_by<boost::multi_index::hashed_unique<boost::multi_index::tag<repgen::refper_types::hash_index_tag,
mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
mpl_::na, mpl_::na, mpl_::na, mpl_::na>,
boost::multi_index::member<repgen::refper_types::entry_type,
std::vector<std::basic_string<char,
std::char_traits<char>, std::allocator<char> >,
std::allocator<std::basic_string<char,
std::char_traits<char>, std::allocator<char> > > >,
&repgen::refper_types::entry_type::keys>, mpl_::na,
mpl_::na>,
boost::multi_index::ordered_non_unique<boost::multi_index::tag<repgen::refper_types::pred_index_tag,
mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
mpl_::na, mpl_::na, mpl_::na, mpl_::na>,
boost::multi_index::identity<repgen::refper_types::entry_type>,
mpl_::na>, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
mpl_::na, mpl_::na, mpl_::na, mpl_::na>,
std::allocator<repgen::refper_types::entry_type> >,
TagList =
boost::mpl::v_item<repgen::refper_types::hash_index_tag,
boost::mpl::vector0<mpl_::na>, 0>, Category =
boost::multi_index::detail::hashed_unique_tag]
refper_key.cpp:272: instantiated from here
/usr/include/boost/functional/hash/hash.hpp:132:
error: no matching function for call to
hash_value(const std::vector<std::basic_string<char,
std::char_traits<char>, std::allocator<char> >,
std::allocator<std::basic_string<char,
std::char_traits<char>, std::allocator<char> > > >&)
/usr/include/boost/functional/hash/hash.hpp:89: note:
candidates are: size_t boost::hash_value(int)
/usr/include/boost/functional/hash/hash.hpp:94: note:
size_t boost::hash_value(unsigned int)
/usr/include/boost/functional/hash/hash.hpp:99: note:
size_t boost::hash_value(long int)
/usr/include/boost/functional/hash/hash.hpp:104: note:
size_t boost::hash_value(long unsigned
int)
/usr/include/boost/functional/hash/hash.hpp:293: note:
size_t boost::hash_value(float)
/usr/include/boost/functional/hash/hash.hpp:298: note:
size_t boost::hash_value(double)
/usr/include/boost/functional/hash/hash.hpp:303: note:
size_t boost::hash_value(long double)
Thanks!
Andrej
___________________________________________________________
Yahoo! Mail is the world's favourite email. Don't settle for less, sign up for
your free account today http://uk.rd.yahoo.com/evt=44106/*http://uk.docs.yahoo.com/mail/winter07.html
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