aboutsummaryrefslogtreecommitdiff
path: root/odb/boost
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2012-04-23 16:48:02 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2012-04-23 16:48:02 +0200
commitdb36504c7ff191c2d965abd6462bb56d2566bab9 (patch)
tree9b7a887fae5340c87894a94ff8b07c884eaa23bd /odb/boost
parent2882ddc09ac599588d83c9d4efedc649929a1597 (diff)
Polymorphic inheritance support
Diffstat (limited to 'odb/boost')
-rw-r--r--odb/boost/smart-ptr/pointer-traits.hxx16
1 files changed, 15 insertions, 1 deletions
diff --git a/odb/boost/smart-ptr/pointer-traits.hxx b/odb/boost/smart-ptr/pointer-traits.hxx
index 6a454f2..3a4a956 100644
--- a/odb/boost/smart-ptr/pointer-traits.hxx
+++ b/odb/boost/smart-ptr/pointer-traits.hxx
@@ -52,11 +52,25 @@ namespace odb
}
static unrestricted_pointer_type
- cast (const pointer_type& p)
+ const_pointer_cast (const pointer_type& p)
{
return ::boost::const_pointer_cast<unrestricted_element_type> (p);
}
+ template <typename T1>
+ static ::boost::shared_ptr<T1>
+ static_pointer_cast (const pointer_type& p)
+ {
+ return ::boost::static_pointer_cast<T1> (p);
+ }
+
+ template <typename T1>
+ static ::boost::shared_ptr<T1>
+ dynamic_pointer_cast (const pointer_type& p)
+ {
+ return ::boost::dynamic_pointer_cast<T1> (p);
+ }
+
public:
static void*
allocate (std::size_t n)