Thank you for the respones.
Escape is just a little shitty game. If you collect the coins, the game runs faster, if you hit the red evil monster the bad red wall comes to you. If you hit the wall its game over. I thought the game would be nicer but it turned out not to be the case. I just also wanted to share it
Little game showcases
Re: Little game showcases
Very likely due to copy elision.albinopapa wrote:Is this because the default implementation would be something like ?chili wrote:I don't think this is true. Do you have a reference for this?cameron wrote:When copy/move op = is called on a class that contains a ref, It just calls the copy constructor of the object it references.
This code works fine as expected: http://cpp.sh/8l5h
The copy constructor of object referenced by the member is def not being invoked. Default behavior for copy constructor is basically invoke copy operator all embedded objects, copy bits for simple data types and aggregates (including ptr/ref).By the by, this code doesn't compile in the C++ shell, but does compile and runs in VS2015 and VS2017.Code: Select all
memcpy( &b2, &b1, sizeof(B) );
http://cpp.sh/4rzs
@Florian
Sorry for hijacking your thread bro
Chili