VR-Forces 4.7 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
polymorphic_pointer_downcast.h
Go to the documentation of this file.
1 
2 
3 
4 
5 #pragma once
6 
7 #include <boost/shared_ptr.hpp>
8 
11 template <typename Derived, typename Base>
12 inline boost::shared_ptr<Derived> polymorphic_pointer_downcast(
13  const boost::shared_ptr<Base>& b)
14 {
15 #ifdef _DEBUG
16  boost::shared_ptr<Derived> d(boost::dynamic_pointer_cast<Derived>(b));
17  assert(d);
18  return d;
19 #else
20  return boost::static_pointer_cast<Derived>(b);
21 #endif
22 }

Document ID: Generated on Fri Apr 26 21:53:14 EDT 2019 from SVN revision 197883
Copyright © 2005-2019 VT MAK. All Rights Reserved (www.mak.com)