CARLA
载入中...
搜索中...
未找到
LibCarla
source
carla
TypeTraits.h
浏览该文件的文档.
1
// Copyright (c) 2017 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
11
namespace
carla
{
//定义一个叫做carla的类
12
13
template
<
typename
... Ts>
// 定义一个模板结构体,接受可变数量的类型参数
14
struct
are_same
;
// 引入 type_traits 库,用于类型相关的操作,如 std::is_same
15
16
template
<
typename
T0,
typename
T1,
typename
... Ts>
// 针对至少两个类型的特化
17
struct
are_same
<T0, T1, Ts...> {
18
static
constexpr
bool
value = std::is_same<T0, T1>::value &&
are_same
<T0, Ts...>::value;
//定义一个静态常量布尔成员变量
19
};
20
21
template
<
typename
T0,
typename
T1>
// 针对两个类型的特化
22
struct
are_same
<T0, T1> {
23
static
constexpr
bool
value = std::is_same<T0, T1>::value;
// 检查 T0 和 T1 是否相同
24
};
25
26
}
// namespace carla
carla
CARLA模拟器的主命名空间。
Definition
Carla.cpp:139
carla::are_same
Definition
TypeTraits.h:14
制作者
1.10.0