Kaydet (Commit) 58d20429 authored tarafından Herbert Dürr's avatar Herbert Dürr

#i122208# avoid default assignment operator of recursive STL containers

support for recursive STL containers is not required by the standard.
Boost TR1 containers allow them explicitly though but for some compiler/stl
combinations there are constness issues that prevent the default
assignment operator to work. Adding a small helper function solves
this problem in a clean way.
üst 919e9930
...@@ -98,7 +98,7 @@ Partial::Partial( ...@@ -98,7 +98,7 @@ Partial::Partial(
rtl::OUString seg; rtl::OUString seg;
bool end = parseSegment(*i, &n, &seg); bool end = parseSegment(*i, &n, &seg);
if (end) { if (end) {
p->children[seg] = Node(); p->children[seg].clear();
break; break;
} }
Node::Children::iterator j(p->children.find(seg)); Node::Children::iterator j(p->children.find(seg));
......
...@@ -26,14 +26,13 @@ ...@@ -26,14 +26,13 @@
#include "sal/config.h" #include "sal/config.h"
#include <map> #include <boost/unordered_map.hpp> // using the boost container because it explicitly allows recursive types
#include <set> #include <set>
#include "boost/noncopyable.hpp" #include "boost/noncopyable.hpp"
#include "path.hxx" #include "path.hxx"
#include "rtl/ustring.hxx"
namespace rtl { class OUString; }
namespace configmgr { namespace configmgr {
...@@ -51,9 +50,10 @@ public: ...@@ -51,9 +50,10 @@ public:
private: private:
struct Node { struct Node {
typedef std::map< rtl::OUString, Node > Children; typedef boost::unordered_map< rtl::OUString, Node > Children;
Node(): startInclude(false) {} Node(): startInclude(false) {}
void clear() { startInclude=false; children.clear(); }
Children children; Children children;
bool startInclude; bool startInclude;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment