Little game showcases

The Partridge Family were neither partridges nor a family. Discuss.
Florian3321
Posts: 27
Joined: February 12th, 2017, 1:50 pm

Re: Little game showcases

Post by Florian3321 » May 13th, 2017, 9:31 pm

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 ;)

User avatar
chili
Site Admin
Posts: 3948
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Re: Little game showcases

Post by chili » May 14th, 2017, 3:52 am

albinopapa wrote:
chili wrote:
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.
I don't think this is true. Do you have a reference for this?

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).
Is this because the default implementation would be something like ?

Code: Select all

memcpy( &b2, &b1, sizeof(B) );
By the by, this code doesn't compile in the C++ shell, but does compile and runs in VS2015 and VS2017.
http://cpp.sh/4rzs
Very likely due to copy elision.

@Florian
Sorry for hijacking your thread bro :P
Chili

Post Reply