提交 22d90fcc 编写于 作者: A Alexey Milovidov

Miscellaneous [#CLICKHOUSE-2].

上级 3b65d955
......@@ -37,7 +37,7 @@ public:
}
/// Take an ownership of first version.
MultiVersion(T * value)
MultiVersion(const T * value)
{
set(value);
}
......@@ -47,7 +47,7 @@ public:
set(std::move(value));
}
MultiVersion(std::unique_ptr<T> && value)
MultiVersion(std::unique_ptr<const T> && value)
{
set(std::move(value));
}
......@@ -61,19 +61,19 @@ public:
}
/// Update an object with new version.
void set(Version value)
void set(const Version & value)
{
std::lock_guard lock(mutex);
current_version = value;
}
/// Update an object with new version and take an ownership of it.
void set(T * value)
void set(const T * value)
{
set(Version(value));
}
void set(std::unique_ptr<T> && value)
void set(std::unique_ptr<const T> && value)
{
set(Version(value.release()));
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册