VR-Forces Development_Version Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator 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 Tue Mar 8 22:13:38 EST 2016 from SVN revision 162938
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)