add move-constructor and move-assignment for class dragger

This commit is contained in:
Jinhao
2016-01-06 04:25:48 +08:00
parent 70ecce5962
commit 57303d302c
2 changed files with 48 additions and 1 deletions

View File

@@ -1,5 +1,17 @@
/*
* A Dragger Implementation
* Nana C++ Library(http://www.nanapro.org)
* Copyright(C) 2003-2016 Jinhao(cnjinhao@hotmail.com)
*
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*
* @file: nana/gui/dragger.cpp
*/
#include <nana/gui/dragger.hpp>
#include <nana/gui/programming_interface.hpp>
namespace nana
{
@@ -180,6 +192,23 @@ namespace nana
delete impl_;
}
dragger::dragger(dragger&& other)
: impl_(other.impl_)
{
other.impl_ = nullptr;
}
dragger& dragger::operator=(dragger&& other)
{
if (this != &other)
{
delete impl_;
impl_ = other.impl_;
other.impl_ = nullptr;
}
return *this;
}
void dragger::target(window wd)
{
impl_->drag_target(wd, rectangle(), nana::arrange::horizontal_vertical);