dictionary: Removed the move constructor and assignment operator
because they cannot update the parent dictionary reference.
This commit is contained in:
@ -365,6 +365,8 @@ Foam::dictionary::dictionary
|
||||
IDLList<entry>(dict, *this),
|
||||
parent_(dictionary::null)
|
||||
{
|
||||
std::cerr<< "dictionary::dictionary " << dict.name() << std::endl;
|
||||
|
||||
forAllIter(IDLList<entry>, *this, iter)
|
||||
{
|
||||
hashedEntries_.insert(iter().keyword(), &iter());
|
||||
@ -381,20 +383,6 @@ Foam::dictionary::dictionary
|
||||
}
|
||||
|
||||
|
||||
Foam::dictionary::dictionary
|
||||
(
|
||||
dictionary&& dict
|
||||
)
|
||||
:
|
||||
dictionaryName(move(dict.name())),
|
||||
IDLList<entry>(move(dict)),
|
||||
hashedEntries_(move(dict.hashedEntries_)),
|
||||
parent_(dict.parent_),
|
||||
patternEntries_(move(dict.patternEntries_)),
|
||||
patternRegexps_(move(dict.patternRegexps_))
|
||||
{}
|
||||
|
||||
|
||||
Foam::dictionary::dictionary
|
||||
(
|
||||
const dictionary* dictPtr
|
||||
@ -409,26 +397,6 @@ Foam::dictionary::dictionary
|
||||
}
|
||||
|
||||
|
||||
Foam::dictionary::dictionary
|
||||
(
|
||||
const dictionary& parentDict,
|
||||
dictionary&& dict
|
||||
)
|
||||
:
|
||||
dictionaryName(move(dict.name())),
|
||||
IDLList<entry>(move(dict)),
|
||||
hashedEntries_(move(dict.hashedEntries_)),
|
||||
parent_(parentDict),
|
||||
patternEntries_(move(dict.patternEntries_)),
|
||||
patternRegexps_(move(dict.patternRegexps_))
|
||||
{
|
||||
if (parentDict.name() != fileName::null)
|
||||
{
|
||||
name() = parentDict.name()/name();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Foam::autoPtr<Foam::dictionary> Foam::dictionary::clone() const
|
||||
{
|
||||
return autoPtr<dictionary>(new dictionary(*this));
|
||||
@ -1428,24 +1396,6 @@ void Foam::dictionary::operator=(const dictionary& rhs)
|
||||
}
|
||||
|
||||
|
||||
void Foam::dictionary::operator=(dictionary&& rhs)
|
||||
{
|
||||
// Check for assignment to self
|
||||
if (this == &rhs)
|
||||
{
|
||||
FatalIOErrorInFunction(*this)
|
||||
<< "attempted assignment to self for dictionary " << name()
|
||||
<< abort(FatalIOError);
|
||||
}
|
||||
|
||||
dictionaryName::operator=(move(rhs));
|
||||
IDLList<entry>::operator=(move(rhs));
|
||||
hashedEntries_ = move(rhs.hashedEntries_);
|
||||
patternEntries_ = move(rhs.patternEntries_);
|
||||
patternRegexps_ = move(rhs.patternRegexps_);
|
||||
}
|
||||
|
||||
|
||||
void Foam::dictionary::operator+=(const dictionary& rhs)
|
||||
{
|
||||
// Check for assignment to self
|
||||
|
||||
@ -313,13 +313,6 @@ public:
|
||||
// A null pointer is treated like an empty dictionary.
|
||||
dictionary(const dictionary*);
|
||||
|
||||
//- Move constructor transferring parameter contents
|
||||
// given parent dictionary
|
||||
dictionary(const dictionary& parentDict, dictionary&&);
|
||||
|
||||
//- Move constructor
|
||||
dictionary(dictionary&&);
|
||||
|
||||
//- Construct and return clone
|
||||
autoPtr<dictionary> clone() const;
|
||||
|
||||
@ -808,8 +801,6 @@ public:
|
||||
|
||||
void operator=(const dictionary&);
|
||||
|
||||
void operator=(dictionary&&);
|
||||
|
||||
//- Include entries from the given dictionary.
|
||||
// Warn, but do not overwrite existing entries.
|
||||
void operator+=(const dictionary&);
|
||||
|
||||
Reference in New Issue
Block a user