X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Socket%2FSocketHandle.cti;h=b04f1f8133f9bf7e2ca6555cc5f342f6b5bba9e1;hb=58a75247c7915bf6fa5e8205d06cdc4a9adfc537;hp=39b32734aa07196df15eee2ac2306b701a58ed0e;hpb=d2459b6c8249291588fd3d0d125ed3d38e003b55;p=senf.git diff --git a/Socket/SocketHandle.cti b/Socket/SocketHandle.cti index 39b3273..b04f1f8 100644 --- a/Socket/SocketHandle.cti +++ b/Socket/SocketHandle.cti @@ -133,11 +133,11 @@ prefix_ Target senf::static_socket_cast(Source handle) template prefix_ Target senf::dynamic_socket_cast(Source handle) { - BOOST_STATIC_ASSERT(( - boost::is_convertible::value && - boost::is_convertible::value && - ( boost::is_convertible::value || - boost::is_convertible::value ) )); +// BOOST_STATIC_ASSERT(( +// boost::is_convertible::value && +// boost::is_convertible::value && +// ( boost::is_convertible::value || +// boost::is_convertible::value ) )); try { return Target::cast_dynamic(handle); } @@ -147,11 +147,11 @@ prefix_ Target senf::dynamic_socket_cast(Source handle) template prefix_ bool senf::check_socket_cast(Source handle) { - BOOST_STATIC_ASSERT(( - boost::is_convertible::value && - boost::is_convertible::value && - ( boost::is_convertible::value || - boost::is_convertible::value ) )); +// BOOST_STATIC_ASSERT(( +// boost::is_convertible::value && +// boost::is_convertible::value && +// ( boost::is_convertible::value || +// boost::is_convertible::value ) )); // we don't have a non-throwing variant of cast_dynamic // for two reasons: // a) since the handle is passed back by value, we cannot return @@ -187,6 +187,17 @@ prefix_ std::string senf::SocketHandle::dumpState(unsigned lod) return detail::dumpState(map); } +template +template +prefix_ Facet const & senf::SocketHandle::facet() + +{ + try { + return dynamic_cast(protocol()); + } + SENF_WRAP_EXC(std::bad_cast) +} + /////////////////////////////////////////////////////////////////////////// // senf::ProtocolSocketBody