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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T00:07:58+00:00 2026-06-10T00:07:58+00:00

In the Boost.Fusion documentation it says that BOOST_FUSION_ADAPT_STRUCT makes a struct a fully compatible

  • 0

In the Boost.Fusion documentation it says that BOOST_FUSION_ADAPT_STRUCT makes a struct a fully compatible Boost.Fusion random access sequence.
I tried the following:

#include <iostream>
#include <boost/fusion/include/adapt_struct.hpp>
#include <boost/fusion/include/at.hpp>

struct Str {
    int i;
    float j;
};

BOOST_FUSION_ADAPT_STRUCT(
    Str,
    (int, i)
    (float, j)
)

int main() {
    Str s;
    boost::fusion::at<0>(s) = 1;
}

And I received an error from the compiler saying “no matching function for call to at(Str&)”.
The compiler I’m using is g++.
What am I doing wrong?
Thanks in advance.

  • 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-10T00:08:00+00:00Added an answer on June 10, 2026 at 12:08 am
    boost::fusion::at<boost::mpl::int_<0>>(s) = 1;
    

    Because N must be an MPL integral constant

    Boost::fusion::at

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

Sidebar

Related Questions

I've got a Boost.Fusion sequence of elements that need to be initialized one each
I am getting to know boost::variant. I think this example should work. #include <boost/fusion/sequence.hpp>
I have the following two boost::fusion maps. namespace bf = boost::fusion; typedef bf::map<bf::pair<char,float>,bf::pair<int,double>> FusionMap;
I'm trying to get iterator for boost::fusion::map , but I'm missing something. The following
Boost::bind documentation states: By default, bind makes a copy of the provided function object.
Is it possible to use boost::fusion::invoke function to call a function that has default
I'm very new to boost::spirit/fusion. Could someone please explain to me why the following
I am trying to use Boost::Fusion (Boost v1.42.0) in a personal project. I get
// ... snipped includes for iostream and fusion ... namespace fusion = boost::fusion; class
#include <tuple> #include <vector> #include <string> #include <iostream> //------------------------------------------------------------------------- #include <boost/spirit/include/karma.hpp> #include <boost/fusion/adapted/std_tuple.hpp> //-------------------------------------------------------------------------

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.