Merge with MS "private instead of protected in CRTP" changes

This commit is contained in:
Klaus Basan
2013-05-01 00:51:57 +02:00
3 changed files with 49 additions and 48 deletions

View File

@@ -23,6 +23,26 @@ 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 +81,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