зеркало из https://github.com/microsoft/CCF.git
C++ 20 (#2862)
This commit is contained in:
Родитель
5071cb4441
Коммит
8fb7d74990
|
@ -74,4 +74,4 @@ function(add_warning_checks name)
|
|||
)
|
||||
endfunction()
|
||||
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
|
|
|
@ -580,8 +580,6 @@ namespace kv
|
|||
|
||||
using NamedHandleMixin::NamedHandleMixin;
|
||||
virtual ~AbstractMap() {}
|
||||
virtual bool operator==(const AbstractMap& that) const = 0;
|
||||
virtual bool operator!=(const AbstractMap& that) const = 0;
|
||||
|
||||
virtual std::unique_ptr<AbstractCommitter> create_committer(
|
||||
AbstractChangeSet* changes) = 0;
|
||||
|
|
|
@ -653,17 +653,13 @@ namespace kv::untyped
|
|||
return replicated;
|
||||
}
|
||||
|
||||
bool operator==(const AbstractMap& that) const override
|
||||
bool operator==(const Map& that) const
|
||||
{
|
||||
auto p = dynamic_cast<const Map*>(&that);
|
||||
if (p == nullptr)
|
||||
return false;
|
||||
|
||||
if (name != p->name)
|
||||
if (name != that.name)
|
||||
return false;
|
||||
|
||||
auto state1 = roll.commits->get_tail();
|
||||
auto state2 = p->roll.commits->get_tail();
|
||||
auto state2 = that.roll.commits->get_tail();
|
||||
|
||||
if (state1->version != state2->version)
|
||||
return false;
|
||||
|
@ -706,10 +702,12 @@ namespace kv::untyped
|
|||
return ok;
|
||||
}
|
||||
|
||||
bool operator!=(const AbstractMap& that) const override
|
||||
#ifndef __cpp_impl_three_way_comparison
|
||||
bool operator!=(const Map& that) const
|
||||
{
|
||||
return !(*this == that);
|
||||
}
|
||||
#endif
|
||||
|
||||
std::unique_ptr<AbstractMap::Snapshot> snapshot(Version v) override
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче