I talked to my instructor the other day and asked him this question. He told me that I could go for smaller projects, but I'm starting a chess program and I was wondering what Stack Overflow thinks about this issue. Should I include all headers into one file, or separate them?
相关问题
- Sorting 3 numbers without branching [closed]
- How to compile C++ code in GDB?
- Why does const allow implicit conversion of refere
- thread_local variables initialization
- What uses more memory in c++? An 2 ints or 2 funct
相关文章
- Class layout in C++: Why are members sometimes ord
- How to mock methods return object with deleted cop
- Which is the best way to multiply a large and spar
- C++ default constructor does not initialize pointe
- Selecting only the first few characters in a strin
- What exactly do pointers store? (C++)
- Converting glm::lookat matrix to quaternion and ba
- What is the correct way to declare and use a FILE
I just want to add that, yes this is normally a bad idea, but it can be useful on occasion. Never for entire projects though.
For example, I recently wrote a utility to perform a stack dump on windows. There were 4 common headers I was going to include, so I made (in a
detail
folder, a conventionI stole form boostuse) awindows.hpp
, which included those four. The implementations could then use that header to easily get the necessary functions.While it might not carry the same weight as a mega-includes-480-headers header, it was a grouping of a handful of common headers, and it was quite helpful. the key thing here is it was a small collection of related headers, used in a portion of the code.