aboutsummaryrefslogtreecommitdiff
path: root/odb/tr1
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2012-04-23 16:48:00 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2012-04-23 16:48:00 +0200
commit1896d36996ab48ed7271e855d7e32b4e61f64896 (patch)
tree6d085eb0349d23bc26fe101b2451235939f17d40 /odb/tr1
parentc2be6303f97e470960ee77805128c46d3ea5c102 (diff)
Polymorphic inheritance support
Diffstat (limited to 'odb/tr1')
-rw-r--r--odb/tr1/pointer-traits.hxx16
1 files changed, 15 insertions, 1 deletions
diff --git a/odb/tr1/pointer-traits.hxx b/odb/tr1/pointer-traits.hxx
index 12e1164..310c448 100644
--- a/odb/tr1/pointer-traits.hxx
+++ b/odb/tr1/pointer-traits.hxx
@@ -61,11 +61,25 @@ namespace odb
}
static unrestricted_pointer_type
- cast (const pointer_type& p)
+ const_pointer_cast (const pointer_type& p)
{
return std::tr1::const_pointer_cast<unrestricted_element_type> (p);
}
+ template <typename T1>
+ static std::tr1::shared_ptr<T1>
+ static_pointer_cast (const pointer_type& p)
+ {
+ return std::tr1::static_pointer_cast<T1> (p);
+ }
+
+ template <typename T1>
+ static std::tr1::shared_ptr<T1>
+ dynamic_pointer_cast (const pointer_type& p)
+ {
+ return std::tr1::dynamic_pointer_cast<T1> (p);
+ }
+
public:
static void*
allocate (std::size_t n)