When and why would I use -fno-elide-constructors?
问题 I'm learning C++ and I came across the -fno-elide-constructors , below I have included the description from the man page. -fno-elide-constructors The C++ standard allows an implementation to omit creating a temporary which is only used to initialize another object of the same type. Specifying this option disables that optimization, and forces G++ to call the copy constructor in all cases. So with this option I am able disable this particular type of compiler optimization. I have a program