mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 21:15:33 +08:00
made derived() private instead of protected in CRTP
This commit is contained in:
@@ -23,6 +23,25 @@ class CMatrix3x1; // forward declaration
|
||||
*/
|
||||
template <class ImplVector> class CVector3DBase : public CBaseStreamStringifier<ImplVector>
|
||||
{
|
||||
private:
|
||||
/*!
|
||||
* \brief Easy access to derived class (CRTP template parameter)
|
||||
* \return
|
||||
*/
|
||||
ImplVector const* derived() const
|
||||
{
|
||||
return static_cast<ImplVector const *>(this);
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Easy access to derived class (CRTP template parameter)
|
||||
* \return
|
||||
*/
|
||||
ImplVector* derived()
|
||||
{
|
||||
return static_cast<ImplVector *>(this);
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
// using own value since Qt QVector3D stores internally as float
|
||||
@@ -61,24 +80,6 @@ protected:
|
||||
*/
|
||||
virtual QString stringForConverter() const;
|
||||
|
||||
/*!
|
||||
* \brief Easy access to derived class (CRTP template parameter)
|
||||
* \return
|
||||
*/
|
||||
ImplVector const* derived() const
|
||||
{
|
||||
return static_cast<ImplVector const *>(this);
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Easy access to derived class (CRTP template parameter)
|
||||
* \return
|
||||
*/
|
||||
ImplVector* derived()
|
||||
{
|
||||
return static_cast<ImplVector *>(this);
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
// getter and setters are implemented in the derived classes
|
||||
|
||||
Reference in New Issue
Block a user