template<typename T, typename BaseT = void>
struct mc_rtc::shared< T, BaseT >
This template helper allow to enable implicit conversion from instances of T (resp. const T) to std::shared_ptr<T> (resp. std::shared_ptr<const T>).
This allows mc_rtc to expose reference (or const reference) to internal objects stored as pointer which are often manipulated without requiring ownership or access a "nested" object without incurring extra pointer copies (e.g. accessing a frame of a robot).
- Template Parameters
-
T | The type that should be shared |
BaseT | If provided BaseT must inherit shared<BaseT>. shared<T, BaseT> then inherits BaseT with added conversions for T |