add move-constructor and move-assignment for class dragger
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user