Please see the discussion between Sara and I here: http://www.experts-exchange.com/Q_27382621.html
Clearly, we disagree over our interpretation of the C++ standard so I thought this might be a nice one for a discussion topic. So the question is:
From a constructor conversion point of view, is this...
size_t s = 1000;
char c = char(s);
...semantically the same as this...
size_t s = 1000;
char * pc = new char(s);
...in the sense that in the latter case a constructor conversion take please just like it does in the former cast.
The C++ standard states...
A simple-type-specifier followed by a parenthesized expression-list constructs a value of the specified
type given the expression list. If the expression list is a single expression, the type conversion expression
is equivalent (in definedness, and if defined in meaning) to the corresponding cast expression (5.4).
5.4 Explicit type conversion (cast notation) [expr.cast]
1 The result of the expression (T) cast-expression is of type T. The result is an lvalue if T is a reference
type, otherwise the result is an rvalue. [Note: if T is a non-class type that is cv-qualified, the cv-qualifiers
are ignored when determining the type of the resulting rvalue; see 3.10. ]
And as well as the links I posted in the other thread, in support of my understanding I also offer...
The main problem is I was unable to locate anything that specifically stated or was unequivocally clear about the fact that when using the new operator to create a fundamental type if a value is passed into the constructor of said type it will perform a constructor conversion cast just the same as if the fundamental was being created on the stack.
Points will be awarded for anyone who can provide absolute proof one way or the other. I don't mind being wrong (although I'm pretty sure I am now) but given there are two differing views on this and I was unable to provide a single and unequivocal and authoritative example, for Sara, in the case of fundamental types.
I look forward to your thoughts.