Jump to content
  • Advertisement
Sign in to follow this  
Wavarian

What's your stance on..

This topic is 4955 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

..Defining methods with no implementation? For instance:

class CClass {

	// Member data that doesn't support copying

private:

	// No implementations
	CClass(const CClass &c);
	const CClass& operator =(const CClass &c);
};



I've just been scouting about the internet, and have found many articles saying that this is a definite no-no. But it does have its purpose in the above scenario.. right?

Share this post


Link to post
Share on other sites
Advertisement
For disabling copy construction or assignment, it makes sense to me, and it's fairly idiomatic C++ to do so. Though, in this case, the access restriction is more significant than the lack of member function definition.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!