next up previous
Next: clone() Up: The Strategy Pattern Previous: The Strategy Pattern

Improved Implementation

Consider:
class NearestNeighbour
{
private:
    DistanceBase* _d;
public:
    NearestNeighbour(DistanceBase& d) : _d(&d) {}
...


Tim Cootes
2/24/1998