CARLA
 
载入中...
搜索中...
未找到
MoveHandler.h
浏览该文件的文档.
1// Copyright (c) 2019 Computer Vision Center (CVC) at the Universitat Autonoma
2// de Barcelona (UAB).
3//
4// This work is licensed under the terms of the MIT license.
5// For a copy, see <https://opensource.org/licenses/MIT>.
6
7#pragma once
8
9#include <type_traits>
10#include <utility>
11
12namespace carla {
13namespace detail {
14
15 template <typename FunctorT>
25
26} // namespace detail
27
28 /// Hack to trick asio into accepting move-only handlers, if the handler were
29 /// actually copied it would result in a link error.
30 ///
31 /// @see https://stackoverflow.com/a/22891509.
32 template <typename FunctorT>
33 auto MoveHandler(FunctorT &&func) {
34 using F = typename std::decay<FunctorT>::type;
35 return detail::MoveWrapper<F>{std::move(func)};
36 }
37
38} // namespace carla
This file contains definitions of common data structures used in traffic manager.
Definition Carla.cpp:133
auto MoveHandler(FunctorT &&func)
Hack to trick asio into accepting move-only handlers, if the handler were actually copied it would re...
Definition MoveHandler.h:33
MoveWrapper & operator=(const MoveWrapper &)
MoveWrapper(const MoveWrapper &)
MoveWrapper(MoveWrapper &&)=default
MoveWrapper & operator=(MoveWrapper &&)=default