Both
std::istreamandstd::ostreamare actually not defined in<iostream>, despite the fact that they look similar. They're respectively defined in<istream>and<ostream>.You should instead include these in the implementation file and include
<iosfwd><iosfwd>(the iostream declaration forwarding library) in the header.These data members should be
private:glm::vec3 position; glm::vec3 normal; glm::vec2 texCoord;Otherwise, they will be accessible outside of the class. If they are not meant to be this way, then you should use a
structinstead, which arepublicby default.If you don't need a default constructor, then leave it out. The compiler will provide one for you.
Regarding
operator==:Conditional operators overloads, such as
operator==, should beconstas they should not modify any data members:bool operator==(const Vertex& other) const;Its definition could also be split into multiple lines, which is easier to read than one long line:
bool Vertex::operator==(const Vertex& other) { return position == other.position && normal == other.normal && texCoord == other.texCoord; }