From 1ac7e7129dcf403602e23ffe8793bb69eedae2f7 Mon Sep 17 00:00:00 2001 From: "Vicente J. Botet Escriba" Date: Sun, 12 Aug 2012 16:36:40 +0000 Subject: [PATCH] Thread: refix 6174 [SVN r79980] --- include/boost/thread/future.hpp | 2 +- test/test_6174.cpp | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/include/boost/thread/future.hpp b/include/boost/thread/future.hpp index 557d96c0..44da4367 100644 --- a/include/boost/thread/future.hpp +++ b/include/boost/thread/future.hpp @@ -484,7 +484,7 @@ namespace boost void mark_finished_with_result(rvalue_source_type result_) { boost::lock_guard lock(mutex); - mark_finished_with_result_internal(result_); + mark_finished_with_result_internal(static_cast(result_)); } move_dest_type get() diff --git a/test/test_6174.cpp b/test/test_6174.cpp index a6b6761e..cd7ed4e7 100644 --- a/test/test_6174.cpp +++ b/test/test_6174.cpp @@ -1,3 +1,8 @@ +// Copyright (C) 2010 Vicente Botet +// +// 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) + #include @@ -16,13 +21,21 @@ private: public: MovableButNonCopyable() {}; MovableButNonCopyable(MovableButNonCopyable&&) {}; - MovableButNonCopyable& operator=(MovableButNonCopyable&&) { + MovableButNonCopyable& operator=(MovableButNonCopyable&&) + { return *this; }; }; + +MovableButNonCopyable construct() +{ + return MovableButNonCopyable(); +} + int main() { - boost::packaged_task(MovableButNonCopyable()); + boost::packaged_task pt(construct); + pt(); return 0; } #else