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(
rtl::OUString seg;
bool end = parseSegment(*i, &n, &seg);
if (end) {
p->children[seg] = Node();
p->children[seg].clear();
break;
}
Node::Children::iterator j(p->children.find(seg));
......
......@@ -26,14 +26,13 @@
#include "sal/config.h"
#include <map>
#include <boost/unordered_map.hpp> // using the boost container because it explicitly allows recursive types
#include <set>
#include "boost/noncopyable.hpp"
#include "path.hxx"
namespace rtl { class OUString; }
#include "rtl/ustring.hxx"
namespace configmgr {
......@@ -51,9 +50,10 @@ public:
private:
struct Node {
typedef std::map< rtl::OUString, Node > Children;
typedef boost::unordered_map< rtl::OUString, Node > Children;
Node(): startInclude(false) {}
void clear() { startInclude=false; children.clear(); }
Children children;
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