Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » U++ Developers corner » How to fix this strong behaviore of MSC compiler & temporary value ?
Re: How to fix this strong behaviore of MSC compiler & temporary value ? [message #45268 is a reply to message #44616] Mon, 26 October 2015 12:51 Go to previous message
omari is currently offline  omari
Messages: 265
Registered: March 2010
Experienced Member
I think the best solution is to never use "const &", but use rval_

class A 
{
public:
	int x;
	A():x(0)             	{}

	A( A rval_ a) 			{ LOG("from A");x = a.x;}
	A(String rval_ s) 		{ LOG("from String");}
	operator String() 		{ LOG("to String"); return ""; }
};


work as expected.


regards
omari.
 
Read Message
Read Message
Read Message
Previous Topic: Initialization for Buffer<T>
Next Topic: mingw/gdb troubles
Goto Forum:
  


Current Time: Sun May 05 11:52:18 CEST 2024

Total time taken to generate the page: 0.01853 seconds