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

  • SEARCH
  • Home
  • 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 7702355
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T23:12:31+00:00 2026-05-31T23:12:31+00:00

I have a very simplified question regarding sequenced indices in boost multi index. The

  • 0

I have a very simplified question regarding sequenced indices in boost multi index. The code is as below:

my class stored in Link.hpp:

#include <string>

class Link  {
public:
    Link(std::string l,std::string r) :linkID(l),roadName(r) {}
    Link() {}
    std::string roadName;
    std::string linkID;

};

and the main function:

#include "Link.hpp"
#include <string>
#include <iostream>
#include <boost/multi_index_container.hpp>
#include <boost/multi_index/member.hpp>
#include <boost/multi_index/ordered_index.hpp>
#include <boost/multi_index/sequenced_index.hpp>
#include <boost/multi_index/key_extractors.hpp>

using boost::multi_index::multi_index_container;
using boost::multi_index::ordered_non_unique;
using boost::multi_index::ordered_unique;
using boost::multi_index::sequenced;
using boost::multi_index::indexed_by;
using boost::multi_index::member;

typedef boost::multi_index::multi_index_container<Link,
        indexed_by<sequenced<> > > Links;

int main() {
    Links Ls;
    Ls.insert(Link("123", "456"));

    return 1;
}

the compilation, when sequenced<> is present, yields an error I don’t understand. could you please help me with that?

Error:

$ g++ Links.cpp 
Links.cpp: In function ‘int main()’:
Links.cpp:29:29: error: no matching function for call to ‘boost::multi_index::multi_index_container<Link, boost::multi_index::indexed_by<boost::multi_index::sequenced<> > >::insert(Link)’
Links.cpp:29:29: note: candidates are:
/usr/include/boost/multi_index/sequenced_index.hpp:267:28: note: std::pair<boost::multi_index::detail::bidir_node_iterator<boost::multi_index::detail::sequenced_index_node<typename SuperMeta::type::node_type> >, bool> boost::multi_index::detail::sequenced_index<SuperMeta, TagList>::insert(boost::multi_index::detail::sequenced_index<SuperMeta, TagList>::iterator, boost::multi_index::detail::sequenced_index<SuperMeta, TagList>::value_param_type) [with SuperMeta = boost::multi_index::detail::nth_layer<1, Link, boost::multi_index::indexed_by<boost::multi_index::sequenced<> >, std::allocator<Link> >, TagList = boost::mpl::vector0<mpl_::na>, typename SuperMeta::type::node_type = boost::multi_index::detail::index_node_base<Link, std::allocator<Link> >, boost::multi_index::detail::sequenced_index<SuperMeta, TagList>::iterator = boost::multi_index::detail::bidir_node_iterator<boost::multi_index::detail::sequenced_index_node<boost::multi_index::detail::index_node_base<Link, std::allocator<Link> > > >, boost::multi_index::detail::sequenced_index<SuperMeta, TagList>::value_param_type = const Link&]
/usr/include/boost/multi_index/sequenced_index.hpp:267:28: note:   candidate expects 2 arguments, 1 provided...................
  • 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-05-31T23:12:32+00:00Added an answer on May 31, 2026 at 11:12 pm

    insert expects an iterator as first argument to specify where within the container you want to insert. It would seem multi_index_container also have push_back, which probably is closer to what you want.

    So to insert at the beginning of the sequence:

    Ls.insert( Ls.begin(), Link( "123", "456" ) );
    

    Or at the back of it:

    Ls.push_back( Link( "123", "456" ) );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is very simplified version of code that i have: class PrintJob : IEntity
I have the following tables defined declaratively (very simplified version): class Profile(Base): __tablename__ =
For example (and this is very simplified), suppose I have a class for every
I have a linq to sql database. Very simplified we have 3 tables, Projects
I have two modules like this (very very simplified): main.py: from window import *
Another PL/SQL refactoring question! I have several cursors that are of the general simplified
I have a question regarding how to get the white- and black-listing feature of
This is my situation, very much simplified. My classes; public class ClassBase { [Key]
Let's assume we have this very simple table: |class |student| --------------- Math Alice Math
We have very strange problem, one of our applications is continually querying server by

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.