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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T10:19:07+00:00 2026-05-21T10:19:07+00:00

I am trying to initialize a set with more than one member in my

  • 0

I am trying to initialize a set with more than one member in my member initialization list and I am not sure about the syntax. The ** is where I am getting my syntax error (without the ** of course). Thanks. Here is an example:

//=============================================================================
class myClass_t
{
//-----------------------------------------------------------------------------
public: // FUNCTIONS
//-----------------------------------------------------------------------------

    //-------------------------------------------------------------------------
    // Constructor
    myClass_t
        (
        )
    :
        BaseClass_t( IDD_BASEPAGE ),
        **mCapabilities( 1, 2 ),
        mDevice( mCapabilities )
    {
    }

    //-------------------------------------------------------------------------
    // Destructor
    ~myClass_t
        (
        )
    {
    }

//-----------------------------------------------------------------------------
private: // DATA
//-----------------------------------------------------------------------------

    fdx::myDevice_t               mDevice;    
    std::set<int>                 mCapabilities;

}; // end of class

} // end of namespace
  • 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-21T10:19:07+00:00Added an answer on May 21, 2026 at 10:19 am

    If you can use the Boost Assign library, the thing you ask for is easy:

    #include <boost/assign/list_of.hpp>
    ...
    mCapabilities(boost::assign::list_of(1)(2))
    ...
    

    I’ve just tested it on MSVC8 and it works fine.

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

Sidebar

Related Questions

See the code below. If I initialize more than one entity context, then I
I have a list string tag. I am trying to initialize a dictionary with
how to initialize a private static member of a class in java. trying the
I'm trying to initialize a session but i get this error: Warning: session_start() [function.session-start]:
I am trying to initialize my controls in Silverlight. I am looking for something
I'm trying to initialize string with iterators and something like this works: ifstream fin(tmp.txt);
Edited again because it originally wasn't clear that I'm trying to initialize the arrays
I'm trying to write a simple program in VC++ which will just initialize the
How do I initialize a 2D array in Perl? I am trying the following
I would like my thread to shut down more gracefully so I am trying

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.