Jun 18, 2016 at 6:56pm UTC
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
//Point.h
#ifndef POINT_H
#define POINT_H
struct Point
{
int x;
int y;
}
bool operator ==(const Point& lhs, const Point& rhs)
{
return lhs.x == rhs.x && lhs.y == rhs.y;
}
#endif // POINT_H
How might I use this in several translation units without the use of a corresponding .cpp file? In its current state, this would produce a "multiple definitions" error.
Is this possible? Thanks in advance!
Last edited on Jun 18, 2016 at 6:57pm UTC
Jun 18, 2016 at 7:43pm UTC
Oh boy...now I feel dumb. I appreciate the help though. I was under the assumption that inline's only purpose was to act as a hint for the compiler.
Last edited on Jun 18, 2016 at 7:43pm UTC