hpx::future<hpx::id_type> create(Ts &&... ts) const
 {
     cuda::target t = get_next_target();
     hpx::id_type target_locality = t.native_handle().get_locality();
     return components::stub_base<Component>::create_async(
         target_locality, std::forward<Ts>(ts)..., std::move(t));
 }
 hpx::future<hpx::id_type> create(Ts&&... vs) const
 {
     // by default the object will be created on the current
     // locality
     return components::stub_base<Component>::create_async(
         get_next_target(), std::forward<Ts>(vs)...);
 }
 bool apply_cb(
     threads::thread_priority priority, Callback&& cb, Ts&&... vs) const
 {
     return hpx::detail::apply_cb_impl<Action>(
         get_next_target(), priority,
         std::forward<Callback>(cb), std::forward<Ts>(vs)...);
 }
 HPX_FORCEINLINE hpx::future<
     typename traits::promise_local_result<
         typename hpx::actions::extract_action<Action>::remote_result_type
     >::type>
 async(launch policy, Ts&&... vs) const
 {
     return hpx::detail::async_impl<Action>(policy,
         get_next_target(), std::forward<Ts>(vs)...);
 }
// ----------------------------------------------------------------
// class to find next chain lightning target
// handle impact of bolt on a secondary target
// ----------------------------------------------------------------
void t_chain_bolt::impact()
{
	t_combat_creature_ptr target	  = m_already_hit.back();
	int					  damage;

	damage = target->modify_spell_damage( m_caster, m_power, k_spell_lightning );
	target->add_damage( damage, m_caster, false, false, m_action_message );
	target->check_flinch( m_action_message );
	get_next_target();
}
        hpx::future<std::vector<bulk_locality_result> >
        bulk_create(std::size_t count, Ts&&... vs) const
        {
            // by default the object will be created on the current
            // locality
            hpx::id_type id = get_next_target();
            hpx::future<std::vector<hpx::id_type> > f =
                components::stub_base<Component>::bulk_create_async(
                    id, count, std::forward<Ts>(vs)...);

            return f.then(hpx::launch::sync,
                [id](hpx::future<std::vector<hpx::id_type> > && f)
                    -> std::vector<bulk_locality_result>
                {
                    std::vector<bulk_locality_result> result;
#if !defined(HPX_GCC_VERSION) || HPX_GCC_VERSION >= 408000
                    result.emplace_back(id, f.get());
#else
                    result.push_back(std::make_pair(id, f.get()));
#endif
                    return result;
                });
        }
// ----------------------------------------------------------------
// class to find next chain lightning target
// handle start of a new bolt
// ----------------------------------------------------------------
void t_chain_bolt::operator()( t_window* )
{
	get_next_target();
}
 bool apply(
     threads::thread_priority priority, Ts&&... vs) const
 {
     return hpx::detail::apply_impl<Action>(
         get_next_target(), priority, std::forward<Ts>(vs)...);
 }