Jump to content
  • Advertisement
Sign in to follow this  
Friggle

'void' Preceding constructor

This topic is 2943 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

When the Ctor of a class is preceded by a 'void' specifier then it isn't called but seems to be compiled just as some new valid function.

Example:


class CTest
{
// Invalid Ctor definition, does not cause error
// and won't be called when creating an instance of the class!
void CTest()
{
Trace("Ctor Call!\r\n");
}
}



Could that be a candidate for a compiler improvement? I think a C++ compiler will generate an error in this case.

Regards,
Thomas

Share this post


Link to post
Share on other sites
Advertisement
Sorry for this one, you are right:
I am using 2.19.0 in my latest official release build. In my development version which uses 2.19.2 the compiler correctly raises an error message.

Regards

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!