Original Post
I have a very basic undestanding of STL, but I am trying to get better. I have come across a situation that has me stumped. I created this simple template point class....
namespace nm_geometric
{
template <typename tType>
class Point
{
public:
tType x, y, z;
~Point()
{
}
Point() : x(0.0),
y(0.0),
z(0.0){}
Point(const Point& param) : x(param.x),
y(param.y),
z(param.z){}
Point(const tType X, const tType Y, const tType Z)
{
x = X;
y = Y;
z = Z;
}
};
}
int main()
{
using namespace nm_geometric;
Point<float> p1(1, 4, 0);
Point<float> p2(7, 9, 0);
Point<float> p3(4, 2, 0);
/* HERE LIES THE PROBLEM. I HAVE NO CLUE HOW TO
PASS THESE POINTS INTO AN STL CONTAINER LIKE
STACK, LIST, VECTOR, ETC. SO THAT I CAN DO ALL
THAT COOL STL STUFF LIKE SORT, COUNT, ETC. PLEASE
HELP
*/
//stack<Point> vertices;
return 0;
}
THANK YOU.
[edited by - kelaklub on January 4, 2004 3:11:51 PM]