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 707037
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:13:57+00:00 2026-05-14T04:13:57+00:00

I am trying to use Boost::Fusion (Boost v1.42.0) in a personal project. I get

  • 0

I am trying to use Boost::Fusion (Boost v1.42.0) in a personal project. I get an interesting error with this code:

#include "boost/fusion/include/sequence.hpp"
#include "boost/fusion/include/make_vector.hpp"
#include "boost/fusion/include/insert.hpp"
#include "boost/fusion/include/invoke_procedure.hpp"
#include "boost/fusion/include/make_vector.hpp"
#include <iostream>

class Class1
{ 
    public:
    typedef boost::fusion::vector<int,float,float,char,int,int> SequenceType;
    SequenceType s;
        Class1(SequenceType v):s(v){}
};

class Class2
{
    public:
    Class2(){}
    void met(int a,float b ,float c ,char d ,int e,int f)
    {
        std::cout << a << " " << b << " " << c << " " << d << " " << e << std::endl;
    }
};

int main(int argn, char**)
{
Class2 p;
Class1 t(boost::fusion::make_vector(9,7.66f,8.99f,'s',7,6));
boost::fusion::begin(t.s); //OK
boost::fusion::insert(t.s, boost::fusion::begin(t.s), &p); //OK
boost::fusion::invoke_procedure(&Class2::met,boost::fusion::insert(t.s, boost::fusion::begin(t.s), &p)); //FAILS
}

It fails to compile (gcc 4.4.1):

In file included from /home/thechaos/Escriptori/of_preRelease_v0061_linux_FAT/addons/ofxTableGestures/ext/boost/fusion/include/invoke_procedur
e.hpp:10,
                 from problema concepte.cpp:11:
/home/thechaos/Escriptori/of_preRelease_v0061_linux_FAT/addons/ofxTableGestures/ext/boost/fusion/functional/invocation/invoke_procedure.hpp: I
n function ‘void boost::fusion::invoke_procedure(Function, const Sequence&) [with Function = void (Class2::*)(int, float, float, char, int, in
t), Sequence = boost::fusion::joint_view<boost::fusion::joint_view<boost::fusion::iterator_range<boost::fusion::vector_iterator<const boost::f
usion::vector<int, float, float, char, int, int, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_>, 0>, 
boost::fusion::vector_iterator<boost::fusion::vector<int, float, float, char, int, int, boost::fusion::void_, boost::fusion::void_, boost::fus
ion::void_, boost::fusion::void_>, 0> >, const boost::fusion::single_view<Class2*> >, boost::fusion::iterator_range<boost::fusion::vector_iter
ator<boost::fusion::vector<int, float, float, char, int, int, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion:
:void_>, 0>, boost::fusion::vector_iterator<const boost::fusion::vector<int, float, float, char, int, int, boost::fusion::void_, boost::fusion
::void_, boost::fusion::void_, boost::fusion::void_>, 6> > >]’:
problema concepte.cpp:39:   instantiated from here
/home/thechaos/Escriptori/of_preRelease_v0061_linux_FAT/addons/ofxTableGestures/ext/boost/fusion/functional/invocation/invoke_procedure.hpp:88
: error: incomplete type ‘boost::fusion::detail::invoke_procedure_impl<void (Class2::*)(int, float, float, char, int, int), const boost::fusio
n::joint_view<boost::fusion::joint_view<boost::fusion::iterator_range<boost::fusion::vector_iterator<const boost::fusion::vector<int, float, f
loat, char, int, int, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_>, 0>, boost::fusion::vector_itera
tor<boost::fusion::vector<int, float, float, char, int, int, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::
void_>, 0> >, const boost::fusion::single_view<Class2*> >, boost::fusion::iterator_range<boost::fusion::vector_iterator<boost::fusion::vector<
int, float, float, char, int, int, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_>, 0>, boost::fusion:
:vector_iterator<const boost::fusion::vector<int, float, float, char, int, int, boost::fusion::void_, boost::fusion::void_, boost::fusion::voi
d_, boost::fusion::void_>, 6> > >, 7, true, false>’ used in nested name specifier

However, if I change the number of arguments in the vectors and the method from 6 to 5 from int,float,float,char,int,int to int,float,float,char,int,I can compile it without problems.

I suspected about the maximum number of arguments being a limitation, but I tried to change it through defining FUSION_MAX_VECTOR_SIZE without success.

I am unable to see what am I doing wrong. Can you reproduce this? Can it be a boost bug (i doubt it but is not impossible)?

  • 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-14T04:13:57+00:00Added an answer on May 14, 2026 at 4:13 am

    Yes indeed, you need to change some iteration limits. You’re just changing the wrong one. 🙂

    What you need to define is BOOST_FUSION_INVOKE_PROCEDURE_MAX_ARITY; by default, it is 6. You obviously need 7 (but might as well bump it to 10):

    #define BOOST_FUSION_INVOKE_PROCEDURE_MAX_ARITY 10
    
    #include "boost/fusion/include/sequence.hpp"
    #include "boost/fusion/include/make_vector.hpp"
    #include "boost/fusion/include/insert.hpp"
    #include "boost/fusion/include/invoke_procedure.hpp"
    #include "boost/fusion/include/make_vector.hpp"
    #include <iostream>
    .
    .
    .
    

    There are three total within the invocation domain.

    Whenever you’re looking for the limit of something, search for “Limits” on the documentation. Choose the one relevant to what you’re doing. From there, it tells you the defaults and what the options are.


    Just concerning the code itself, I should point out there is a push_front function:

    #include "boost/fusion/include/push_front.hpp"
    
    // ...
    
    boost::fusion::invoke_procedure(&Class2::met,
                                    boost::fusion::push_front(t.s, &p));
    

    So you don’t need to do the more verbose insert-at-begin.

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

Sidebar

Related Questions

I'm trying to use the boost library in my code but get the following
I'm trying to use boost::dynamic_bitset, as shown below: #include <boost/dynamic_bitset.hpp> class Bitmap { public:
When trying to use boost regex library by #include'ing boost/regex.hpp and then creating object
I am trying to use boost::bind with a boost::function using this. It seems a
I'm trying to use boost::iterator_facade with an incomplete Value template argument. This fails, because
At the following code I am trying to use Boost Spirit Auto Parser for
So, I'm trying to use boost.process library. I downloaded package from this location ,
I am trying to use Boost's lexical_cast for my C++ project but am running
I'm scratching my head on this one. I'm trying to use boost::variant to store
i'm trying to use boost regex within my program the problem is i get

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.