gcc 4.8: expression list treated as compound expression in mem-initializer

W

woodbrian77

How to fix this?

g++ -o receivesample -std=c++0x -O3 -s -W -Wall -I. -I /usr/local/include-DMAKEFILES receivesample.cc MsgHelper.cg.o /usr/local/lib/libhome.a
In file included from /usr/local/include/c++/4.8.0/set:60:0,
from receivesample.cc:13:
/usr/local/include/c++/4.8.0/bits/stl_tree.h: In instantiation of 'std::_Rb_tree_node<_Val>::_Rb_tree_node(_Args&& ...) [with _Args = {std::_Rb_tree_const_iterator<unsigned int>&, unsigned int}; _Val = unsigned int]':
/usr/local/include/c++/4.8.0/ext/new_allocator.h:120:4: required from 'void __gnu_cxx::new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = std::_Rb_tree_node<unsigned int>; _Args = {std::_Rb_tree_const_iterator<unsigned int>&, unsigned int}; _Tp = std::_Rb_tree_node<unsigned int>]'
/usr/local/include/c++/4.8.0/bits/stl_tree.h:403:8: required from 'std::_Rb_tree_node<_Val>* std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_create_node(_Args&& ...) [with _Args = {std::_Rb_tree_const_iterator<unsigned int>&, unsigned int}; _Key = unsigned int; _Val = unsigned int; _KeyOfValue = std::_Identity<unsigned int>; _Compare = std::less<unsigned int>; _Alloc = std::allocator<unsigned int>; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Link_type = std::_Rb_tree_node<unsigned int>*]'
/usr/local/include/c++/4.8.0/bits/stl_tree.h:1615:64: required from 'std::pair<std::_Rb_tree_iterator<_Val>, bool> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_emplace_unique(_Args&& ...) [with _Args = {std::_Rb_tree_const_iterator<unsigned int>&, unsigned int}; _Key = unsignedint; _Val = unsigned int; _KeyOfValue = std::_Identity<unsigned int>; _Compare = std::less<unsigned int>; _Alloc = std::allocator<unsigned int>]'
/usr/local/include/c++/4.8.0/bits/stl_set.h:414:64: required from 'std::pair<typename std::_Rb_tree<_Key, _Key, std::_Identity<_Key>, _Compare, typename _Alloc::rebind<_Key>::eek:ther>::const_iterator, bool> std::set<_Key, _Compare, _Alloc>::emplace(_Args&& ...) [with _Args = {std::_Rb_tree_const_iterator<unsigned int>&, unsigned int}; _Key = unsigned int; _Compare = std::less<unsigned int>; _Alloc = std::allocator<unsigned int>; typename std::_Rb_tree<_Key, _Key, std::_Identity<_Key>, _Compare, typename _Alloc::rebind<_Key>::eek:ther>::const_iterator = std::_Rb_tree_const_iterator<unsigned int>]'
../MsgHelper.cg.hh:56:5: required from 'void MsgHelper::Receive(cmw::ReceiveBuffer<R>&, std::set<unsigned int>&) [with R = SameFormat]'
receivesample.cc:53:39: required from here
/usr/local/include/c++/4.8.0/bits/stl_tree.h:137:49: error: expression listtreated as compound expression in mem-initializer [-fpermissive]
_M_value_field(std::forward<_Args>(__args)...) { }
^


template <class R>
void
Receive :):cmw::ReceiveBuffer<R>& buf
,::std::set<uint32_t>& az1
)
{
uint32_t count[1];
count[0]=buf.template Give<uint32_t>();
auto endIt1=az1.end();
for(;count[0]>0;--count[0]){
az1.emplace(endIt1, buf.template Give<uint32_t>());
}
}

I believe it doesn't like the emplace call.

That function is called from this program
http://webEbenezer.net/misc/samples/receivesample.cc
..

I've built and installed the March 10, 2013 version of
gcc 4.8. I've built and run several programs with it,
but then ran into this. Tia.


Brian
Ebenezer Enterprises - in G-d we trust.
http://webEbenezer.net
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top