From 3b766d94bfa2e2c3b72deae192d46fc7eec2b441 Mon Sep 17 00:00:00 2001 From: Zhu Yuejun Date: Mon, 20 Feb 2017 18:08:43 +0800 Subject: [PATCH] Create noncopyable.h --- include/noncopyable.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 include/noncopyable.h diff --git a/include/noncopyable.h b/include/noncopyable.h new file mode 100644 index 0000000..b80c1e3 --- /dev/null +++ b/include/noncopyable.h @@ -0,0 +1,24 @@ +// Copyright (c) 2017, Baidu.com, Inc. All Rights Reserved +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +// + +#ifndef BAIDU_COMMON_NONCOPYABLE_H_ +#define BAIDU_COMMON_NONCOPYABLE_H_ + +namespace baidu { +namespace common { + +class noncopyable { +public: + noncopyable() {} + ~noncopyable() {} +private: + noncopyable(const noncopyable&) {} + void operator=(const noncopyable&) {} +}; + +} // namespace common +} // namespace baidu + +#endif // BAIDU_COMMON_NONCOPYABLE_H_