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:
parent
48f519e785
commit
3f8946c157
3 changed files with 3 additions and 3 deletions
|
|
@ -414,7 +414,7 @@ namespace diff{
|
|||
}
|
||||
|
||||
void
|
||||
replace (Rec& existingInstance) noexcept
|
||||
swap (Rec& existingInstance) noexcept
|
||||
{
|
||||
std::swap (existingInstance, record_);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue