Just a question of style, or possibly even a malpractice I am unaware of.
I am currently writing my first piece of software, which will be used and reviewed by people other than myself. When I am writing my code and calling my headers, is it bad practice to call the same header multiple times across files.
For example
exampleClass.h
#ifndef BUG_H
#define BUG_H
#include<string>
class Bug{
private:
int bug_id; //6 digit int
Date creation_ts; //Date object containing time of creation
std::string short_desc; //Short description of bug
std::string classification; //Catagory of bug_id
std::string product; //What product is the bug regarding
std::string component
}
#endif
anotherExample.h
#ifndef ANOTHEREXAMPLE_H
#define ANOTHEREXAMPLE_H
#include<string>
class Pug{
private:
int bug_id; //6 digit int
Date creation_ts; //Date object containing time of creation
std::string short_desc; //Short description of bug
std::string classification; //Catagory of bug_id
std::string product; //What product is the bug regarding
std::string component
}
#endif
Is there anything wrong with including string twice in two different header files if both have dependencies? Will this cause errors later in the software's life?