Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //SGObject.h
- public:
- template<class T>
- bool equals(const Some<T> & other, float64_t accuracy=0.0, bool tolerant=false)
- {
- equals_impl(some_dynamic_cast<CSGObject>(other), accuracy, tolerant);
- };
- protected:
- virtual bool equals_impl(const Some<CSGObject> & other, float64_t accuracy=0.0, bool tolerant=false)
- {
- /** actual equals code **/
- }
- //some.h
- template <typename U, typename T>
- Some<U> some_dynamic_cast(const Some<T> & other)
- {
- U * tmp = dynamic_cast<U*>(other.get());
- if (tmp==NULL)
- return Some<U>::from_raw(nullptr);
- return Some<U>::from_raw(tmp);
- }
Advertisement
Add Comment
Please, Sign In to add comment