Explicitly define copy/move constructors for accessor

`accessor` currently relies on an implicit default copy constructor, but that is deprecated in C++11 when a copy assignment operator is present and can, in some cases, raise deprecation warnings (see #888).  This commit explicitly specifies the default copy constructor and also adds a default move constructor.
This commit is contained in:
eirrgang 2017-06-06 11:57:17 -04:00 committed by Jason Rhinelander
parent 8f6c129689
commit 91bbe2f2e5

View File

@ -388,6 +388,8 @@ class accessor : public object_api<accessor<Policy>> {
public:
accessor(handle obj, key_type key) : obj(obj), key(std::move(key)) { }
accessor(const accessor &a) = default;
accessor(accessor &&a) = default;
// accessor overload required to override default assignment operator (templates are not allowed
// to replace default compiler-generated assignments).