Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9192859
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T21:01:48+00:00 2026-06-17T21:01:48+00:00

I try to use the following example from boost: #include <boost/container/map.hpp> struct data {

  • 0

I try to use the following example from boost:

#include <boost/container/map.hpp>
struct data
{
    std::string label;
    //A map holding still undefined 'data'
    boost::container::map<std::string, data> m_;
};

int main(int argc, char* argv[])
{
    data d,d1,d2;
    d.m_["hello"] = d1;
    return 0;
}

unfortunately it does not compile and I can’t figure why.

Compilers Message (just the end of it):
../../3d_party_4_5_8/boost_1_49_0/boost/container/detail/tree.hpp|183| error: no match for גoperator=ג in ג((boost::container::container_detail::rbtree_node, std::allocator >, data>, void*>*)this)->boost::container::container_detail::rbtree_node, std::allocator >, data>, void*>::m_data.boost::container::container_detail::pair, std::allocator >, data>::second = p->boost::container::container_detail::pair, std::allocator >, data>::secondג
Analyzer.cpp|139| note: candidates are: data& data::operator=(data&)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T21:01:49+00:00Added an answer on June 17, 2026 at 9:01 pm

    I think you are compiling in C++03 mode:
    Please see Assignment operator in classes derived from or holding copyable and movable types. Your assignment operator is non-const as shown in the error message: data& data::operator=(data&), this is the problem. boost::container emulates move semantics in C++03 compilers, and in order to do this defines a non-const copy constructor. One possible solution is too add the following to data:

    data& operator=(data x)
    {
        std::swap(*this, x); 
        return *this;
    }
    

    or

    data& operator=(const data& x)
    {
        label = x.label 
        return *this;
    }
    

    depending on your needs.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I try to use the following code: ArrayList<String> Map<String, String> Eclipse complains about both
I try use string as a regular expression pattern but I've following errors PHP
I use the following code try to create an array of string vectors, I
it is my first cocos2d app I try, and I am following example from
I face the following exception when i try to use parametrized query with informix
When I try to use SDL in my c++ program, I get the following:
I am getting the following exception when i try to use the fetchall method
I am getting the following error when i try to use a blue tooth
I have the following script running successfully. However if I try to use a
I'm getting the following error when I try to extend SalatDAO or use grater[T].asObject(x):

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.