From eea18f732b6d61ef1eea1701161acd518cea5a7e Mon Sep 17 00:00:00 2001 From: levlam Date: Wed, 31 Jan 2018 00:36:53 +0300 Subject: [PATCH] Fix operator bool and default members. GitOrigin-RevId: a981ac683c91ae9ba656b036cf1b56ff462f039d --- td/telegram/files/FileManager.cpp | 1 - td/telegram/files/FileManager.h | 12 ++---------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/td/telegram/files/FileManager.cpp b/td/telegram/files/FileManager.cpp index 83eec6bda..fc26bedc3 100644 --- a/td/telegram/files/FileManager.cpp +++ b/td/telegram/files/FileManager.cpp @@ -54,7 +54,6 @@ FileNodePtr::operator bool() const { return file_manager_ != nullptr && get_unsafe() != nullptr; } -/*** FileNodePtr **/ void FileNode::set_local_location(const LocalFileLocation &local, int64 ready_size) { if (local_ready_size_ != ready_size) { local_ready_size_ = ready_size; diff --git a/td/telegram/files/FileManager.h b/td/telegram/files/FileManager.h index 7521d8e38..9f0f39963 100644 --- a/td/telegram/files/FileManager.h +++ b/td/telegram/files/FileManager.h @@ -129,15 +129,11 @@ class FileNodePtr { FileNodePtr() = default; FileNodePtr(FileId file_id, FileManager *file_manager) : file_id_(file_id), file_manager_(file_manager) { } - FileNodePtr(FileNodePtr &&other) = default; - FileNodePtr(const FileNodePtr &other) = default; - FileNodePtr &operator=(FileNodePtr &&other) = default; - FileNodePtr &operator=(const FileNodePtr &other) = default; FileNode *operator->() const; FileNode &operator*() const; FileNode *get() const; - operator bool() const; + explicit operator bool() const; private: FileId file_id_; @@ -150,10 +146,6 @@ class ConstFileNodePtr { ConstFileNodePtr() = default; ConstFileNodePtr(FileNodePtr file_node_ptr) : file_node_ptr_(file_node_ptr) { } - ConstFileNodePtr(ConstFileNodePtr &&other) = default; - ConstFileNodePtr(const ConstFileNodePtr &other) = default; - ConstFileNodePtr &operator=(ConstFileNodePtr &&other) = default; - ConstFileNodePtr &operator=(const ConstFileNodePtr &other) = default; const FileNode *operator->() const { return file_node_ptr_.operator->(); @@ -162,7 +154,7 @@ class ConstFileNodePtr { return file_node_ptr_.operator*(); } - operator bool() const { + explicit operator bool() const { return bool(file_node_ptr_); }