better naming of Record::Mutator content moving operation

while the original name, 'replace', conveys the intention,
this more standard name 'swap' reveals what is done
and thus opens a wider array of possible usage
This commit is contained in:
Fischlurch 2016-03-03 22:58:33 +01:00
parent 48f519e785
commit 3f8946c157
3 changed files with 3 additions and 3 deletions

View file

@ -414,7 +414,7 @@ namespace diff{
}
void
replace (Rec& existingInstance) noexcept
swap (Rec& existingInstance) noexcept
{
std::swap (existingInstance, record_);
}

View file

@ -330,7 +330,7 @@ namespace test{
CHECK (mut != aa);
mut.replace(a);
mut.swap (a);
CHECK (isnil (mut));
CHECK (Seq({"a = α", "b = β", "", "a"}) == contents(a));
CHECK (Seq({"a = 1", "a"}) == contents(aa));

View file

@ -158,7 +158,7 @@ namespace test{
CHECK ( isnil (content));
CHECK (!isnil (mut));
mut.replace(subject);
mut.swap (subject);
CHECK (Seq({"a = α", "b = β", "γ", "δ", "ε"}) == contents(subject));
CHECK ("Rec(🌰| a = α, b = β |{γ, δ, ε})" == string(subject));
}