Should a standard include header be specified in each file or as a compiler parameter?

Posted by Max on Programmers See other posts from Programmers or by Max
Published on 2012-03-03T19:31:37Z Indexed on 2012/07/09 3:22 UTC
Read the original article Hit count: 199

Filed under:
|
|

I've got a file such as this:

#ifndef STDINCLUDE
#define STDINCLUDE

#include <memory>
#include <stdexcept>

#endif

I want this file to be included in every header file, because I use stuff from those headers so much. Is it preferable to include this via compiler options (-I stdinclude.hpp), or should I physically include them in each header? (#include <stdinclude>). Note that I am attempting to be cross-platform-minded. I use cmake to serve atleast Unix and Windows.

© Programmers or respective owner

Related posts about c++

Related posts about compiler