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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:23:25+00:00 2026-06-14T20:23:25+00:00

In Boost there are some convenient functions that let you fill up a container

  • 0

In Boost there are some convenient functions that let you fill up a container in a single line.

For example, list_of lets you fill a list like so.

#include <boost/assign/list_of.hpp> // for 'list_of()'
#include <list>
std::list<int> primes = boost::assign::list_of(2)(3)(5)(7)(11);

On my project I’m using Qt and cannot use Boost. Is there a similarly convenient way for filling up Qt’s containers at the point of construction?

  • 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-14T20:23:26+00:00Added an answer on June 14, 2026 at 8:23 pm

    You can use QList::operator<<

    QList<int> primes = QList<int>() << 2 << 3 << 5 << 7 << 11;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there some magic required to obtain a zlib sync flush when using boost::iostreams::zlib_compressor
Some days ago I looked at boost sources and found interesting typedef . There
Is there anything in boost libraries like binary? For example I would like to
I am looking for some simple and efficient parameter container that would act like
Is there some equivalent class for C++1x's std::unique_ptr in the boost libraries? The behavior
Is there some way to make boost::python control the Python GIL for every interaction
I know there are some threading libraries for C++, like Pthread, Boost etc out
I have some functions that I use to convert a 2D variant SAFEARRAY into
I'm wondering if there's some efficient way to hash std::bitset or boost::dynamic_bitset<> for Boost's
I was wondering if there where some convenient way to access a known index

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.