diff --git a/include/fc/datastream.hpp b/include/fc/datastream.hpp index 8a1eb11..8f2f56d 100644 --- a/include/fc/datastream.hpp +++ b/include/fc/datastream.hpp @@ -2,6 +2,7 @@ #define _FC_DATASTREAM_HPP_ #include #include +#include #include namespace fc { diff --git a/include/fc/raw.hpp b/include/fc/raw.hpp index 0505a40..bb878e5 100644 --- a/include/fc/raw.hpp +++ b/include/fc/raw.hpp @@ -4,9 +4,12 @@ #include #include #include +#include //#include -namespace fc { namespace raw { +namespace fc { + class value; + namespace raw { template void unpack( Stream& s, fc::optional& v ); diff --git a/include/fc/shared_ptr.hpp b/include/fc/shared_ptr.hpp index c8f6f9f..0c97504 100644 --- a/include/fc/shared_ptr.hpp +++ b/include/fc/shared_ptr.hpp @@ -26,6 +26,12 @@ namespace fc { template class shared_ptr { public: + template + shared_ptr( const shared_ptr& o ) + :_ptr(o.get()) { + if(_ptr) _ptr->retain(); + } + shared_ptr( T* t, bool inc = false ) :_ptr(t) { if( inc ) t->retain(); } @@ -70,6 +76,11 @@ namespace fc { private: T* _ptr; }; + + template + fc::shared_ptr dynamic_pointer_cast( const fc::shared_ptr& t ) { + return fc::shared_ptr( dynamic_cast(t.get()), true ); + } } #endif diff --git a/include/fc/static_reflect.hpp b/include/fc/static_reflect.hpp index b8b69e5..d70a77b 100644 --- a/include/fc/static_reflect.hpp +++ b/include/fc/static_reflect.hpp @@ -8,6 +8,7 @@ #ifndef _FC_STATIC_REFLECT_HPP_ #define _FC_STATIC_REFLECT_HPP_ +#include #include #include #include