Slashdot is powered by your submissions, so send in your scoop

 



Forgot your password?
typodupeerror
×

Comment Re:Build-in function library (Score 1) 831

There is no need to ANY copy to implement that on a well made compile. Move stack pointer (faster and cleaner than a NEW), execute constructor code (equaly necessary on both cases), call the method bar using that stack address as this pointer and with parameter someotherarg. The copy could arise if you return as COPY form the bar method something whose constructor is not trivial and have side effects. Returning anything complex by copy is by itself a bad practice in C++. Do not write code that needs to return anything complex by copy. That is why I said, C++ suck when you use the WRONG mentality alongside it. If you think and use it as it was supposed to be used... no issues .

Comment Re:Build-in function library (Score 1) 831

Bad example. Because that is an example tough on the logic of people use donly to GC languages. Computers have 2 different memmories (on a proccess level memory concept) stack and heap. You do NOT need to put everything on heap! In fact 95% of EVERY object in a typical C++ code, specially all the temporaries will be at stack with ZERO chance of any overhead of malfunction. You can and you SHOULD usually write in C++ return Foo(somearg).bar(someotherarg). Because you are not LIMITED to heap objects.

Slashdot Top Deals

The Tao is like a glob pattern: used but never used up. It is like the extern void: filled with infinite possibilities.

Working...