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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T00:41:27+00:00 2026-05-30T00:41:27+00:00

I have a table represented by a std::vector where every element is a boost::fusion::vector

  • 0

I have a “table” represented by a std::vector where every element is a boost::fusion::vector. I need to return a representation of a “column” of this table as a std::vector, without copying any values over. What is the best way of doing this? I am trying to construct a std::vector of nviews where n is the column number, but it does not seem to be working. Am I on the right track or are there other ways of going about this?

  • 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-30T00:41:30+00:00Added an answer on May 30, 2026 at 12:41 am

    As per the docs here, the at<N>(s) method of the boost::fusion::vector‘s return a reference to the contained element.

    Also if you are using boost library version 1.48, they support the move semantics of C++11. What this means is you can have a function which loops over the size of your table for a particular column no, say i, and populates a column vector which is an std::vector. You then just return this column vector and the calling function would get the moved std::vector. No copies are made at any point.

    You can read more about the move semantics here at the standards page itself. You can also watch the video of Bjarne Stroustrup explaining it in brief here. Jump to minute 37 and watch till minute 43.

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

Sidebar

Related Questions

Need a query help. I have a table where data is represented like this
So I have a table that looks like this: A B A C B
I have a table with two columns; names and items (represented by images). <table>
I have an NSImageCell table column whose valuePath is bound to a path supplied
I have a simple tree structure represented like this: Node { int Id; int
I have database table represented as text file in the following pattern: 0|ALGERIA|0| haggle.
I have questions which are represented like this in my SQL database : CREATE
I have a Mysql table with DATE column , default '0000-00-00'. If I try
A simple question about gnuplot. i have a data represented in a table, that
I have a table of data that looks a bit like this: Name StartTime

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.