diff --git a/include/eigenpy/angle-axis.hpp b/include/eigenpy/angle-axis.hpp index e7aca37a4e4a366ff3151ce4a57091bd263e0e4d..a9accb94f0062c4859b3e4c7782e37f0ec4275d0 100644 --- a/include/eigenpy/angle-axis.hpp +++ b/include/eigenpy/angle-axis.hpp @@ -19,18 +19,15 @@ namespace eigenpy template<typename AngleAxis> class AngleAxisVisitor; - namespace internal + template<typename Scalar> + struct call< Eigen::AngleAxis<Scalar> > { - template<typename Scalar> - struct call_expose< Eigen::AngleAxis<Scalar> > + typedef Eigen::AngleAxis<Scalar> AngleAxis; + static inline void expose() { - typedef Eigen::AngleAxis<Scalar> type; - static inline void run() - { - AngleAxisVisitor<type>::expose(); - } - }; - } // namespace internal + AngleAxisVisitor<AngleAxis>::expose(); + } + }; template<typename AngleAxis> class AngleAxisVisitor diff --git a/include/eigenpy/expose.hpp b/include/eigenpy/expose.hpp index 24158cd2d5a9831964e97cde7ed5ea1639a47d06..9fa8e51bee3963e3418ce543fa613bf12b8b1a21 100644 --- a/include/eigenpy/expose.hpp +++ b/include/eigenpy/expose.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2019, INRIA + * Copyright 2019 INRIA */ #ifndef __eigenpy_expose_hpp__ @@ -9,18 +9,15 @@ namespace eigenpy { - namespace internal + /// + /// \brief Allows a template specialization. + /// + template<typename T> + struct call { - /// - /// \brief Allows a template specialization. - /// - template<typename T> - struct call_expose - { - static inline void run() { T::expose(); } - }; - } // namespace internal - + static inline void expose() { T::expose(); } + }; + /// /// \brief Call the expose function of a given type T. /// @@ -28,7 +25,7 @@ namespace eigenpy inline void expose() { if(!register_symbolic_link_to_registered_type<T>()) - internal::call_expose<T>::run(); + call<T>::expose(); } } diff --git a/include/eigenpy/quaternion.hpp b/include/eigenpy/quaternion.hpp index 610a0347061ba8f8ea4a6b7a1249e441afc80704..e0cd3e6229a614d7351e725513e69f6ceb79c4ad 100644 --- a/include/eigenpy/quaternion.hpp +++ b/include/eigenpy/quaternion.hpp @@ -31,19 +31,16 @@ namespace eigenpy template<typename QuaternionDerived> class QuaternionVisitor; - namespace internal + template<typename Scalar, int Options> + struct call< Eigen::Quaternion<Scalar,Options> > { - template<typename Scalar, int Options> - struct call_expose< Eigen::Quaternion<Scalar,Options> > + typedef Eigen::Quaternion<Scalar,Options> Quaternion; + static inline void expose() { - typedef Eigen::Quaternion<Scalar,Options> type; - static inline void run() - { - QuaternionVisitor<type>::expose(); - } - }; - } // namespace internal - + QuaternionVisitor<Quaternion>::expose(); + } + }; + template<typename Quaternion> class QuaternionVisitor : public bp::def_visitor< QuaternionVisitor<Quaternion> >