I find the syntax of the constructor inheritance slightly odd. The example below works well, but I do not understand why I need to specify using sysTrajectory::sysTrajectory
and not using sysTrajectory<Real>::sysTrajectory<Real>
when inheriting from a class template? The latter gives the following error: expected ‘;’ before ‘<’ token using sysTrajectory<Real>::sysTrajectory<Real>;
.
class sysRealTrajectory: public sysTrajectory<Real>
{
public:
/**
* Default constructor
*/
inline sysRealTrajectory(void);
using sysTrajectory::sysTrajectory;
/**
* Default destructor
*/
inline ~sysRealTrajectory(void);
};
main :
Real a;
a=5;
sysTrajectoryPoint<Real> TP0(1.0,a);
sysRealTrajectory Trajectory(TP0);