Re: conversion from '...' to non-scalar type '...' requested
tthunder@gmx.de wrote:
[...]
classHolder getAHolder()
{ return classHolder (classValue());}
This compiles...
It does???
Is this ok?
No, certainly not.
Nasty trick again?
Or a compiler bug... Or operator error...
Why can't the compiler DO this itself? No you must throw an error...
Are you sure you're using the right compiler?
----------------------------
struct A {};
struct B { B(A&) {} };
B foo() {
return B(A());
}
----------------------------
Thank you for testing your code with Comeau C/C++!
Tell others about http://www.comeaucomputing.com/tryitout !
Your Comeau C/C++ test results are as follows:
Comeau C/C++ 4.3.3 (Aug 6 2003 15:13:37) for ONLINE_EVALUATION_BETA1
Copyright 1988-2003 Comeau Computing. All rights reserved.
MODE:strict errors C++
"ComeauTest.c", line 4: error: no instance of constructor "B::B" matches the
argument list
The argument types that you used are: (A)
return B(A());
^
1 error detected in the compilation of "ComeauTest.c".
In strict mode, with -tused, Compile failed
Hit the Back Button to review your code and compile options.
----------------------------
V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask