Advertisement Jump to content
Sign in to follow this  
Melkon

[C++] Forward declaration VS include in headers

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

Hello!

 

Is there any issue with using forward declaration in header files instead of includes when it's possible?

It will compile faster, however i am not entirely sure if it's a good idea. ohmy.png

 

Thank you for answers!

Melkon

Share this post


Link to post
Share on other sites
Advertisement

Depends what you're wanting to forward declare I guess.

 

There's a time and a place for both (includes and forward declarations). Use forward decls where possible, but don't be afraid to use includes if you need to.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!