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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T17:34:18+00:00 2026-06-14T17:34:18+00:00

As far as I have used converting constructors they look like this: struct X

  • 0

As far as I have used “converting constructors” they look like this:

struct X {
  X(A); // conversion from A -> X
  X(B,C = someC); // conversion from B -> X, with some default C
};
X x1 = A(); // calls X::X(A())
X x2 = B(); // calls X::X(B(),someC)

This makes perfect sense, and as far as I know works as long as you don’t have a constructor:

struct Y {
  Y(A,B); // no implicit conversion
};

However, this is where it gets interesting, the C++11 standard reads literally:

12.3.1 Conversion by constructor

  1. A constructor declared without the function-specifier explicit that can be called with a single parameter specifies a
    conversion from the type of its first parameter types of its parameters to the type of its class. Such a constructor is called
    a converting constructor.

(italics were originally underlined, but markdown doesn’t accept <u>)

This seems to suggest that it was changed that a converting constructor doesn’t have to be callable “with a single parameter” and the change from “type of its first parameter” to “types of its parameters” (note the plural!) further supports this. While I would expect that “type of its first parameter” would be changed to “type of its single non-optional parameter” (1) or even “type of its parameter that received an explicit argument” (2) in order to allow these:

struct Z {
  Z(A = a, B, C = c); // (1)
  Z(D = d, E = e, F = f); // (2)
};
Z = D(); // (2)
Z = E(); // (2)

I don’t see how the formulation with the plural form makes sense: Does it really indicate you can perform conversion with several arguments? What does this mean?

  • 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-14T17:34:19+00:00Added an answer on June 14, 2026 at 5:34 pm

    The language was modified as part of the addition of initializer lists. See n2672: init-list wording.

    An example:

    struct S {
        S(int x, double y) { }
    };
    
    void f(S) { }
    
    int main() {
        f({ 42, 42.0 });
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have used this effect before, everything is in order (As far as I
I'm looking for some help converting this from prototype to jQuery. I'm doing some
so far i have used this code.It is working when i am sending the
I have used just Windows for programming so far. Now, I have an internship
I've had a login I have used so far to login while I was
In the pages so far, I have had used one connection class and one
As far as I remember, Visual Studio (both 2008 and 2010) used to have
I have seen many time that far pointers are used to work for TSR.
So far I have only been updated a view from within its controller. I
What are the recommended uses of IValueConverter? I've used it for things like converting

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.