X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FShareContainer.h;h=084b044095668c1f7dbf5a307476240c52a137d0;hb=5091380d6bad1686800e384ed1bbb03836a15aab;hp=8dd3d9706d61180ffed568fd557c14f4488c1fe7;hpb=fc8465aa1f6f29774d2f35d627b40198fa489cb1;p=lyx.git diff --git a/src/ShareContainer.h b/src/ShareContainer.h index 8dd3d9706d..084b044095 100644 --- a/src/ShareContainer.h +++ b/src/ShareContainer.h @@ -3,11 +3,12 @@ #ifndef SHARECONTAINER_H #define SHARECONTAINER_H +#include +#include + #include #include #include -#include -#include /// Share objects between several users. /** @@ -17,7 +18,7 @@ \author Lars Gullik Bjønnes */ template -class ShareContainer : public boost::noncopyable { +class ShareContainer : boost::noncopyable { public: /// typedef std::vector > Params; @@ -27,9 +28,9 @@ public: value_type get(Share const & ps) const { // First see if we already have this ps in the container - Params::iterator it = std::find_if(params.begin(), - params.end(), - isEqual(ps)); + typename Params::iterator it = std::find_if(params.begin(), + params.end(), + isEqual(ps)); value_type tmp; if (it == params.end()) { // ok we don't have it so we should @@ -66,19 +67,19 @@ private: return p.unique(); } }; - + /** Remove all unique items. This removes all elements from params that is only referenced from the private container. This can be considered a memory optimizaton. */ void clean() const { - Params::iterator it = std::remove_if(params.begin(), - params.end(), - isUnique()); + typename Params::iterator it = std::remove_if(params.begin(), + params.end(), + isUnique()); params.erase(it, params.end()); } - + /// The actual container. mutable Params params; };