Would like to group all header files in my project in one class ,so that i neednt import it in every class rather one header will be enough,
if possible is there any overheads ??
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
It is possible, create another header that includes all other includes and include only it:
common.h:
in each other file, you only need to:
Though I would consider it a bad idea, as you expose more than you need to each class, and you violates the separation of modules in your program. Also, the preprocessor will need to work more, and maybe the compiler as well.