views:

24

answers:

1

I can get the compiler (msvc++ express) to convert "string" as a CustomString in a constructor, but not with a reference. Will it therefore not have the same chance of being optimized out with a pass-by-reference anyway, like passing by value with other types can, if the compiler thinks it can?

won't implicit convert using

new xmlNode("string")

:

 xmlNode( CustomString& label )
 {
    this->text = label;
 }

will :

 xmlNode( CustomString label )
 {
    this->text = label;
 }
A: 

try:

xmlNode(const CustomString& label )
{
    this->text = label;
}
onof
worked, thx!!!!!
Gavin
can you mark as answer, please?
onof