| 152 | |
| 153 | template<typename Subclass = const Track> |
| 154 | inline auto SharedPointer() const -> |
| 155 | std::enable_if_t< |
| 156 | std::is_const_v<Subclass>, std::shared_ptr<Subclass> |
| 157 | > |
| 158 | { |
| 159 | // shared_from_this is injected into class scope by base class |
| 160 | // std::enable_shared_from_this<Track> |
| 161 | return std::static_pointer_cast<Subclass>( shared_from_this() ); |
| 162 | } |
| 163 | |
| 164 | // Static overloads of SharedPointer for when the pointer may be null |
| 165 | template<typename Subclass = Track> |