diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2012-04-23 16:48:00 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2012-04-23 16:48:00 +0200 |
commit | 1896d36996ab48ed7271e855d7e32b4e61f64896 (patch) | |
tree | 6d085eb0349d23bc26fe101b2451235939f17d40 /odb/tr1/pointer-traits.hxx | |
parent | c2be6303f97e470960ee77805128c46d3ea5c102 (diff) |
Polymorphic inheritance support
Diffstat (limited to 'odb/tr1/pointer-traits.hxx')
-rw-r--r-- | odb/tr1/pointer-traits.hxx | 16 |
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) |