Is there any option to use std in a header file without using any #include statement? I have a class in a header file as following;
class Sequence{
private:
std::string sequence;
unsigned length;
public:
/* Constructors */
Sequence (void);
Sequence (std::string, unsigned);
Sequence (const Sequence &);
/* Destructor Definition */
~Sequence(){}
/* Overloaded Assignment */
Sequence & operator
= (const Sequence &seq)
{
sequence = seq.sequence;
length = seq.length;
return *this;
}
/* Setter and Getter Functions */
void setSequence(std::string);
void setLength(unsigned);
std::string getSequence(void);
int getLength(void);
};
It is not compiled correctly without including iostream. However, I read some comments in related questions where we should not include libraries AND another header files in a header file. So?