Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8158913
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T17:45:40+00:00 2026-06-06T17:45:40+00:00

Should I #include everything I need in every header/cpp file? I am working on

  • 0

Should I #include everything I need in every header/cpp file? I am working on a 2d game engine atm (for practice mostly) and in reviewing my code I realise that I repeat string and vector in almost every file. Is this an issue and how do I deal with it?

I’ve always had the opinion that every class or module you write should stand on it’s own two legs, so to speak. I really enjoy generic programming (I’m including my own script language in the engine, with my own drafted script engine) but I also realise it could cause a lot of overhead and confusion.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T17:45:41+00:00Added an answer on June 6, 2026 at 5:45 pm

    I would stick to including <string> and <vector> only where necessary.

    As for making sure individual header files stand on their own, I like how the Google C++ Style Guide deals with include order. Basically, always list the corresponding foo.hpp include before all other includes in foo.cpp. That way, we know that foo.hpp won’t expect something to be included before it and fail if it isn’t there.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

SVector.H: void pop_back() throw (underflow_error); In my SVector.cpp file, should I also include the
I need to collect usage information on my on-demand application. This should include things
I was just wondering what license agreement I should include in an XNA Framework
From what I understand, the output from the following script should include Win32_PerfRawData_PerfDisk_PhysicalDisk in
I'm trying to implement PayPal Adaptive Payments API. Into the headers I should include
How to develope an efficent job scheduling with constraints?? The scheduler should include these
Should I include/require_once the parent class that I am extending in PHP? for example
What are the security topics that you should always include when writing a proposal
Should I be careful adding too many include columns to a non-cluster index? I
In almost every project, I can't decide on how to deal with certain global

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.