Template Class Cloneable¶
Defined in File crtp-clone.h
Class Documentation¶
-
template<typename BaseType, typename DerivedType>
class aslam::Cloneable : public BaseType¶ Implements the cloneable concept using the CRTP and constructor inheritance.
Example:
class Vehicle { Vehicle() = delete; Vehicle(int speed) : speed_(speed) {}; virtual Vehicle* clone() const = 0; // Make sure to add the pure virtual function clone const int speed_; }; class Car : public aslam::Cloneable<Vehicle, Car> { Car(int speed) : Base(speed) {}; // Use the "Base" typedef defined by the Cloneable class };