X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=PPI%2FAnnotationRouter.ct;h=bef2f9c48752fef659fa9ba24bc175e9d57b2407;hb=b8ca4a544cce3e6023bb56b712a03d6362f2bb79;hp=e3342144f86dd25d964a28e3265ff3d58a15113b;hpb=2a7f04c6e922deb5beedc587133af5d836d5a8a9;p=senf.git diff --git a/PPI/AnnotationRouter.ct b/PPI/AnnotationRouter.ct index e334214..bef2f9c 100644 --- a/PPI/AnnotationRouter.ct +++ b/PPI/AnnotationRouter.ct @@ -45,8 +45,16 @@ senf::ppi::module::AnnotationRouter::newOutput(AnnotationType co if (outputs_.find(key) != outputs_.end()) throw DuplicateKeyException(key); // key must not be const ... has something to do with exception guarantees ?? + // From boost 1.34.0 on we can use auto_ptr which we really should for exception safety + // but this doesn't work with boost 1.33.1 :-( +#if BOOST_VERSION >= 103400 + return *outputs_.insert(key, + std::auto_ptr >( + new connector::ActiveOutput<>())).first->second; +#else AnnotationType k (key); return *outputs_.insert(k, new connector::ActiveOutput<>()).first; +#endif } template @@ -56,8 +64,13 @@ prefix_ void senf::ppi::module::AnnotationRouter::request() typename Outputs::iterator i (outputs_.find(p.annotation())); if (i == outputs_.end()) defaultOutput(p); - else + else { +#if BOOST_VERSION >= 103400 + (*i->second)(p); +#else (*i)(p); +#endif + } } ///////////////////////////////ct.e////////////////////////////////////////