Boost logo

Boost Users :

Subject: [Boost-users] Issues trying to use boost::unordered_map
From: Ram (sourceopen_at_[hidden])
Date: 2016-09-28 08:24:07


Hi,

I am trying to use a boost::unordered_map as a member of my class. The
unordered_map is defined as,

boost::unordered_map<int, int> a;

as a private member in the class. I have included

#include "boost/unordered_map.hpp"

using namespace boost;

This is the compilation error I get,

x_objs.cpp
c:\codeworks\common\lib\boost\boost\unordered\detail\buckets.hpp(767) :
error C2059: syntax error : '('

c:\codeworks\common\lib\boost\boost\unordered\detail\buckets.hpp(766) :
while compiling class template member function 'void
boost::unordered::detail::functions<H,P>::construct(bool,const H &,const P
&)'
        with
        [
            H=boost::hash<int>,
            P=std::equal_to<int>
        ]
        c:\codeworks\common\lib\boost\boost\unordered\detail\table.hpp(152)
: see reference to class template instantiation
'boost::unordered::detail::functions<H,P>' being compiled
        with
        [
            H=boost::hash<int>,
            P=std::equal_to<int>
        ]

c:\codeworks\common\lib\boost\boost\unordered\detail\unique.hpp(179) : see
reference to class template instantiation
'boost::unordered::detail::table<Types>' being compiled
        with
        [

Types=boost::unordered::detail::map<std::allocator<std::pair<const
int,int>>,int,int,boost::hash<int>,std::equal_to<int>>
        ]
        c:\codeworks\common\lib\boost\boost\unordered\unordered_map.hpp(74)
: see reference to class template instantiation
'boost::unordered::detail::table_impl<Types>' being compiled
        with
        [

Types=boost::unordered::detail::map<std::allocator<std::pair<const
int,int>>,int,int,boost::hash<int>,std::equal_to<int>>
        ]
        c:\codeworks\sample_issue.h(276) : see reference to class template
instantiation 'boost::unordered::unordered_map<K,T>' being compiled
        with
        [
            K=int,
            T=int
        ]
li_pip.cpp
ld_pip.cpp
pip.cpp
.
.
.

Can someone please help me?

Thanks,
Ram



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