Paul Furgale

Results 48 comments of Paul Furgale

How about the simple approach of ``` c++ class AxisAngle : public Rot { public: /// other methods } ``` Everyone would understand that.

Or...funnier: ``` c++ template class Rot : public ParamPolicy { typedef ParamPolicy::Storage Storage; public: Vec3 rotate(const Vec3 & v){ return ParamPolicy::rotate(storage_, v); } ... // further functions, specifying the outer...

-1 for the traits. This puts the implementation in different places -1 for the default implementation. It makes it not clear what code gets evoked and can cause lookup issues....

Fixed the typo. I meant "proper use of the CRTP when compared to _my_ last proposal". I'm OK with conversion traits if everything else is sane. This even follows the...

Why can't we put the storage in Rot?

Oh...I understand.

How about (ignore the names for now) ``` c++ template class Rot { public: typedef typename RotationTraits::Storage Storage; Vec3 rotate(const Vec3 & v){ return Derived::rotate(storage_, v); } ... // further...

Or...better: ``` c++ template class Rot { public: typedef typename RotationTraits Traits; typedef typename RotationTraits::Storage Storage; Vec3 rotate(const Vec3 & v){ return Traits::rotate(storage_, v); } ... // further functions, specifying...

Here is a full toy example that shows that it is possible: ``` c++ template struct Traits {}; template class Base { public: typedef Traits Traits; typedef typename Traits::Storage Storage;...

One other really cool thing about the above structure: you can define a custom interface class based on the traits. ``` c++ // Define a custom interface class (D2) based...