1 // Copyright (c) 2007-2017 Hartmut Kaiser 2 // 3 // Distributed under the Boost Software License, Version 1.0. (See accompanying 4 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 5 6 #ifndef HPX_ACTIONS_SET_LCO_VALUE_CONTINUATION_HPP 7 #define HPX_ACTIONS_SET_LCO_VALUE_CONTINUATION_HPP 8 9 #include <hpx/config.hpp> 10 11 #include <hpx/runtime/trigger_lco.hpp> 12 #include <hpx/runtime/naming/id_type.hpp> 13 14 #include <utility> 15 16 namespace hpx { namespace actions 17 { 18 /////////////////////////////////////////////////////////////////////////// 19 struct set_lco_value_continuation 20 { 21 template <typename T> operator ()hpx::actions::set_lco_value_continuation22 HPX_FORCEINLINE T operator()(naming::id_type const& lco, T && t) const 23 { 24 hpx::set_lco_value(lco, std::forward<T>(t)); 25 26 // Yep, 't' is a zombie, however we don't use the returned value 27 // anyways. We need it for result type calculation, though. 28 return std::forward<T>(t); 29 } 30 }; 31 32 /////////////////////////////////////////////////////////////////////////// 33 struct set_lco_value_unmanaged_continuation 34 { 35 template <typename T> operator ()hpx::actions::set_lco_value_unmanaged_continuation36 HPX_FORCEINLINE T operator()(naming::id_type const& lco, T && t) const 37 { 38 hpx::set_lco_value_unmanaged(lco, std::forward<T>(t)); 39 40 // Yep, 't' is a zombie, however we don't use the returned value 41 // anyways. We need it for result type calculation, though. 42 return std::forward<T>(t); 43 } 44 }; 45 }} 46 47 #endif 48