Ik probeer in C++ in visual studie 6 mbv de STL (std::sort()) een lijst te sorteren, maar ik krijg allemaal errors naar mijn hoofd, in C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\algorithm.
Kan iemand mij misschien vertellen of het aan mij ligt of aan VC++ ?
dit is in kort wat ik wil:
Kan iemand mij misschien vertellen of het aan mij ligt of aan VC++ ?
dit is in kort wat ik wil:
C++:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
| class Node { public: double currentDistance; typedef std::auto_ptr<Node> Ptr; }; std::list<Node::Ptr> nodes; class CloserNode { public: bool operator () (const Node::Ptr &x, const Node::Ptr &y) { return (x->currentDistance < y->currentDistance); } }; std::sort(nodes.begin(), nodes.end(), CloserNode() ); |