swap.h
Go to the documentation of this file.
1 // Tencent is pleased to support the open source community by making RapidJSON
2 // available.
3 //
4 // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All
5 // rights reserved.
6 //
7 // Licensed under the MIT License (the "License"); you may not use this file
8 // except in compliance with the License. You may obtain a copy of the License
9 // at
10 //
11 // http://opensource.org/licenses/MIT
12 //
13 // Unless required by applicable law or agreed to in writing, software
14 // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15 // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16 // License for the specific language governing permissions and limitations under
17 // the License.
18 
19 #ifndef RAPIDJSON_INTERNAL_SWAP_H_
20 #define RAPIDJSON_INTERNAL_SWAP_H_
21 
22 #include "../rapidjson.h"
23 
24 #if defined(__clang__)
25 RAPIDJSON_DIAG_PUSH
26 RAPIDJSON_DIAG_OFF(c++ 98 - compat)
27 #endif
28 
30 namespace internal {
31 
33 
36 template <typename T>
37 inline void Swap(T &a, T &b) RAPIDJSON_NOEXCEPT {
38  T tmp = a;
39  a = b;
40  b = tmp;
41 }
42 
43 } // namespace internal
45 
46 #if defined(__clang__)
47 RAPIDJSON_DIAG_POP
48 #endif
49 
50 #endif // RAPIDJSON_INTERNAL_SWAP_H_
#define RAPIDJSON_NAMESPACE_END
provide custom rapidjson namespace (closing expression)
Definition: rapidjson.h:131
#define RAPIDJSON_NAMESPACE_BEGIN
provide custom rapidjson namespace (opening expression)
Definition: rapidjson.h:128
void Swap(T &a, T &b) RAPIDJSON_NOEXCEPT
Custom swap() to avoid dependency on C++ <algorithm> header.
Definition: swap.h:37
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition: pointer.h:1365


livox_ros_driver
Author(s): Livox Dev Team
autogenerated on Mon Mar 15 2021 02:40:46