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

Discussion in 'C++' started by woodbrian77@gmail.com, Mar 14, 2013.

  1. Guest

    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
    , Mar 14, 2013
    #1
    1. Advertising

  2. Guest

    On Thursday, March 14, 2013 5:51:17 PM UTC, wrote:
    > How to fix this?
    >


    My error ... need to use emplace_hint.
    , Mar 14, 2013
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jim Heavey
    Replies:
    1
    Views:
    362
    Oisín Grehan
    Dec 2, 2003
  2. Dmitriy Zakharov
    Replies:
    2
    Views:
    423
    Dmitriy Zakharov
    Jul 30, 2004
  3. Replies:
    8
    Views:
    302
    jaysome
    Mar 1, 2007
  4. news.aon.at
    Replies:
    11
    Views:
    627
    Ian Collins
    Jan 29, 2011
  5. Lauri Alanko

    Compound literal without initializer?

    Lauri Alanko, Feb 16, 2011, in forum: C Programming
    Replies:
    3
    Views:
    334
    Lauri Alanko
    Feb 16, 2011
Loading...

Share This Page