Skip to content

Commit 94380de

Browse files
committed
[clang-format] Set language standard to C++17
1 parent b2c4e06 commit 94380de

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+146
-157
lines changed

.clang-format

+1-1
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,6 @@ SpacesInContainerLiterals: true
151151
SpacesInCStyleCastParentheses: false
152152
SpacesInParentheses: false
153153
SpacesInSquareBrackets: false
154-
Standard: Auto
154+
Standard: c++17
155155
TabWidth: 2
156156
UseTab: Never

dart/common/AspectWithVersion.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ template <
4343
class DerivedT,
4444
typename StateDataT,
4545
class CompositeT = Composite,
46-
void (*updateState)(DerivedT*) = &detail::NoOp<DerivedT*> >
46+
void (*updateState)(DerivedT*) = &detail::NoOp<DerivedT*>>
4747
using AspectWithState = detail::AspectWithState<
4848
CompositeTrackingAspect<CompositeT>,
4949
DerivedT,
@@ -56,7 +56,7 @@ template <
5656
class DerivedT,
5757
typename PropertiesDataT,
5858
class CompositeT = Composite,
59-
void (*updateProperties)(DerivedT*) = &detail::NoOp<DerivedT*> >
59+
void (*updateProperties)(DerivedT*) = &detail::NoOp<DerivedT*>>
6060
using AspectWithVersionedProperties = detail::AspectWithVersionedProperties<
6161
CompositeTrackingAspect<CompositeT>,
6262
DerivedT,

dart/common/Cloneable.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ class CloneableVector
303303
CloneableVector& operator=(const CloneableVector& other);
304304

305305
/// Create a copy of this CloneableVector's contents
306-
std::unique_ptr<CloneableVector<T> > clone() const;
306+
std::unique_ptr<CloneableVector<T>> clone() const;
307307

308308
/// Copy the contents of another cloneable vector into this one.
309309
void copy(const CloneableVector<T>& anotherVector);

dart/common/Composite.cpp

+4-6
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,8 @@ template <
5757
typename ObjectType,
5858
class DataType,
5959
const DataType* (ObjectType::*getData)() const,
60-
typename ObjectMap
61-
= std::map<std::type_index, std::unique_ptr<ObjectType> >,
62-
typename DataMap = std::map<std::type_index, std::unique_ptr<DataType> > >
60+
typename ObjectMap = std::map<std::type_index, std::unique_ptr<ObjectType>>,
61+
typename DataMap = std::map<std::type_index, std::unique_ptr<DataType>>>
6362
static void extractDataFromObjectTypeMap(
6463
DataMap& dataMap, const ObjectMap& objectMap)
6564
{
@@ -113,9 +112,8 @@ template <
113112
typename ObjectType,
114113
class DataType,
115114
void (ObjectType::*setData)(const DataType&),
116-
typename ObjectMap
117-
= std::map<std::type_index, std::unique_ptr<ObjectType> >,
118-
typename DataMap = std::map<std::type_index, std::unique_ptr<DataType> > >
115+
typename ObjectMap = std::map<std::type_index, std::unique_ptr<ObjectType>>,
116+
typename DataMap = std::map<std::type_index, std::unique_ptr<DataType>>>
119117
static void setObjectsFromDataTypeMap(
120118
ObjectMap& objectMap, const DataMap& dataMap)
121119
{

dart/common/Composite.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class Composite
5555
using State = detail::CompositeState;
5656
using Properties = detail::CompositeProperties;
5757

58-
using AspectMap = std::map<std::type_index, std::unique_ptr<Aspect> >;
58+
using AspectMap = std::map<std::type_index, std::unique_ptr<Aspect>>;
5959
using RequiredAspectSet = std::unordered_set<std::type_index>;
6060

6161
template <typename... Aspects>

dart/common/CompositeJoiner.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ class CompositeJoiner<Base1, Base2> : public Base1, public Base2
130130
/// you to include arbitrarily many base classes in the joining.
131131
template <class Base1, class Base2, class... OtherBases>
132132
class CompositeJoiner<Base1, Base2, OtherBases...>
133-
: public CompositeJoiner<Base1, CompositeJoiner<Base2, OtherBases...> >
133+
: public CompositeJoiner<Base1, CompositeJoiner<Base2, OtherBases...>>
134134
{
135135
public:
136136
/// Default constructor

dart/common/EmbeddedAspect.hpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ DART_DECLARE_CLASS_WITH_VIRTUAL_BASE_BEGIN
8989

9090
template <class DerivedT, typename StateDataT>
9191
class EmbedState : public virtual common::RequiresAspect<
92-
common::EmbeddedStateAspect<DerivedT, StateDataT> >
92+
common::EmbeddedStateAspect<DerivedT, StateDataT>>
9393
{
9494
public:
9595
using Derived = DerivedT;
@@ -200,7 +200,7 @@ DART_DECLARE_CLASS_WITH_VIRTUAL_BASE_BEGIN
200200
template <class DerivedT, typename PropertiesDataT>
201201
class EmbedProperties
202202
: public virtual common::RequiresAspect<
203-
common::EmbeddedPropertiesAspect<DerivedT, PropertiesDataT> >
203+
common::EmbeddedPropertiesAspect<DerivedT, PropertiesDataT>>
204204
{
205205
public:
206206
using Derived = DerivedT;
@@ -377,7 +377,7 @@ class EmbedStateAndProperties : public virtual common::RequiresAspect<
377377
common::EmbeddedStateAndPropertiesAspect<
378378
DerivedT,
379379
StateDataT,
380-
PropertiesDataT> >
380+
PropertiesDataT>>
381381
{
382382
public:
383383
using Derived = DerivedT;

dart/common/RequiresAspect.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ DART_DECLARE_CLASS_WITH_VIRTUAL_BASE_END
6666
template <class ReqAspect1, class... OtherReqAspects>
6767
class RequiresAspect<ReqAspect1, OtherReqAspects...>
6868
: public CompositeJoiner<
69-
Virtual<RequiresAspect<ReqAspect1> >,
70-
Virtual<RequiresAspect<OtherReqAspects...> > >
69+
Virtual<RequiresAspect<ReqAspect1>>,
70+
Virtual<RequiresAspect<OtherReqAspects...>>>
7171
{
7272
};
7373

dart/common/SpecializedForAspect.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,8 @@ DART_DECLARE_CLASS_WITH_VIRTUAL_BASE_END
192192
template <class SpecAspect1, class... OtherSpecAspects>
193193
class SpecializedForAspect<SpecAspect1, OtherSpecAspects...>
194194
: public CompositeJoiner<
195-
Virtual<SpecializedForAspect<SpecAspect1> >,
196-
Virtual<SpecializedForAspect<OtherSpecAspects...> > >
195+
Virtual<SpecializedForAspect<SpecAspect1>>,
196+
Virtual<SpecializedForAspect<OtherSpecAspects...>>>
197197
{
198198
public:
199199
virtual ~SpecializedForAspect() = default;

dart/common/detail/AspectWithVersion.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ template <
4949
class DerivedT,
5050
typename StateDataT,
5151
class CompositeT = Composite,
52-
void (*updateState)(DerivedT*) = &NoOp<DerivedT*> >
52+
void (*updateState)(DerivedT*) = &NoOp<DerivedT*>>
5353
class AspectWithState : public BaseT
5454
{
5555
public:
@@ -104,7 +104,7 @@ template <
104104
class DerivedT,
105105
typename PropertiesDataT,
106106
class CompositeT = Composite,
107-
void (*updateProperties)(DerivedT*) = &NoOp<DerivedT*> >
107+
void (*updateProperties)(DerivedT*) = &NoOp<DerivedT*>>
108108
class AspectWithVersionedProperties : public BaseT
109109
{
110110
public:

dart/common/detail/EmbeddedAspect.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ template <
7878
void (*setEmbeddedState)(DerivedT*, const StateT&)
7979
= &DefaultSetEmbeddedState<DerivedT, StateT>,
8080
const StateT& (*getEmbeddedState)(const DerivedT*)
81-
= &DefaultGetEmbeddedState<DerivedT, StateT> >
81+
= &DefaultGetEmbeddedState<DerivedT, StateT>>
8282
class EmbeddedStateAspect : public BaseT
8383
{
8484
public:
@@ -245,7 +245,7 @@ template <
245245
void (*setEmbeddedProperties)(DerivedT*, const PropertiesT&)
246246
= &DefaultSetEmbeddedProperties<DerivedT, PropertiesT>,
247247
const PropertiesT& (*getEmbeddedProperties)(const DerivedT*)
248-
= &DefaultGetEmbeddedProperties<DerivedT, PropertiesT> >
248+
= &DefaultGetEmbeddedProperties<DerivedT, PropertiesT>>
249249
class EmbeddedPropertiesAspect : public BaseT
250250
{
251251
protected:

dart/dynamics/BodyNode.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ namespace dynamics {
5454
template <
5555
class DataType,
5656
std::unique_ptr<DataType> (Node::*getData)() const,
57-
typename VectorType = common::CloneableVector<std::unique_ptr<DataType> >,
58-
typename DataMap = std::map<std::type_index, std::unique_ptr<VectorType> > >
57+
typename VectorType = common::CloneableVector<std::unique_ptr<DataType>>,
58+
typename DataMap = std::map<std::type_index, std::unique_ptr<VectorType>>>
5959
static void extractDataFromNodeTypeMap(
6060
DataMap& dataMap, const BodyNode::NodeMap& nodeMap)
6161
{
@@ -84,8 +84,8 @@ static void extractDataFromNodeTypeMap(
8484
template <
8585
class DataType,
8686
void (Node::*setData)(const DataType&),
87-
typename VectorType = common::CloneableVector<std::unique_ptr<DataType> >,
88-
typename DataMap = std::map<std::type_index, std::unique_ptr<VectorType> > >
87+
typename VectorType = common::CloneableVector<std::unique_ptr<DataType>>,
88+
typename DataMap = std::map<std::type_index, std::unique_ptr<VectorType>>>
8989
static void setNodesFromDataTypeMap(
9090
BodyNode::NodeMap& nodeMap, const DataMap& dataMap)
9191
{
@@ -95,7 +95,7 @@ static void setNodesFromDataTypeMap(
9595
while (nodeMap.end() != node_it && dataMap.end() != data_it) {
9696
if (node_it->first == data_it->first) {
9797
const std::vector<Node*>& node_vec = node_it->second;
98-
const std::vector<std::unique_ptr<DataType> >& data_vec
98+
const std::vector<std::unique_ptr<DataType>>& data_vec
9999
= data_it->second->getVector();
100100

101101
// TODO(MXG): Should we report if the dimensions are mismatched?

dart/dynamics/HierarchicalIK.cpp

+3-6
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,7 @@ const std::vector<Eigen::MatrixXd>& HierarchicalIK::computeNullSpaces() const
272272
mNullSpaceCache.resize(hierarchy.size());
273273
bool zeroedNullSpace = false;
274274
for (std::size_t i = 0; i < hierarchy.size(); ++i) {
275-
const std::vector<std::shared_ptr<InverseKinematics> >& level
276-
= hierarchy[i];
275+
const std::vector<std::shared_ptr<InverseKinematics>>& level = hierarchy[i];
277276

278277
Eigen::MatrixXd& NS = mNullSpaceCache[i];
279278
if (i == 0) {
@@ -472,8 +471,7 @@ double HierarchicalIK::Constraint::eval(const Eigen::VectorXd& _x)
472471

473472
double cost = 0.0;
474473
for (std::size_t i = 0; i < hierarchy.size(); ++i) {
475-
const std::vector<std::shared_ptr<InverseKinematics> >& level
476-
= hierarchy[i];
474+
const std::vector<std::shared_ptr<InverseKinematics>>& level = hierarchy[i];
477475

478476
for (std::size_t j = 0; j < level.size(); ++j) {
479477
const std::shared_ptr<InverseKinematics>& ik = level[j];
@@ -509,8 +507,7 @@ void HierarchicalIK::Constraint::evalGradient(
509507

510508
_grad.setZero();
511509
for (std::size_t i = 0; i < hierarchy.size(); ++i) {
512-
const std::vector<std::shared_ptr<InverseKinematics> >& level
513-
= hierarchy[i];
510+
const std::vector<std::shared_ptr<InverseKinematics>>& level = hierarchy[i];
514511

515512
mLevelGradCache.setZero(nDofs);
516513
for (std::size_t j = 0; j < level.size(); ++j) {

dart/dynamics/HierarchicalIK.hpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ namespace dynamics {
4545
/// their gradients added. Precedence of the modules decreases as the index of
4646
/// the outer vector increases. Modules with lower precedence will be projected
4747
/// through the null spaces of modules with higher precedence.
48-
typedef std::vector<std::vector<std::shared_ptr<InverseKinematics> > >
48+
typedef std::vector<std::vector<std::shared_ptr<InverseKinematics>>>
4949
IKHierarchy;
5050

5151
/// The HierarchicalIK class provides a convenient way of setting up a
@@ -351,8 +351,8 @@ class HierarchicalIK : public common::Subject
351351
class CompositeIK : public HierarchicalIK
352352
{
353353
public:
354-
typedef std::unordered_set<std::shared_ptr<InverseKinematics> > ModuleSet;
355-
typedef std::unordered_set<std::shared_ptr<const InverseKinematics> >
354+
typedef std::unordered_set<std::shared_ptr<InverseKinematics>> ModuleSet;
355+
typedef std::unordered_set<std::shared_ptr<const InverseKinematics>>
356356
ConstModuleSet;
357357

358358
/// Create a CompositeIK module
@@ -385,7 +385,7 @@ class CompositeIK : public HierarchicalIK
385385
CompositeIK(const SkeletonPtr& _skel);
386386

387387
/// The set of modules being used by this CompositeIK
388-
std::unordered_set<std::shared_ptr<InverseKinematics> > mModuleSet;
388+
std::unordered_set<std::shared_ptr<InverseKinematics>> mModuleSet;
389389
};
390390

391391
/// The WholeBodyIK class provides an interface for simultaneously solving all

dart/dynamics/NodeManagerJoiner.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ template <class Base1, class Base2, class... OtherBases>
101101
class NodeManagerJoinerForBodyNode<Base1, Base2, OtherBases...>
102102
: public NodeManagerJoinerForBodyNode<
103103
Base1,
104-
NodeManagerJoinerForBodyNode<Base2, OtherBases...> >
104+
NodeManagerJoinerForBodyNode<Base2, OtherBases...>>
105105
{
106106
public:
107107
NodeManagerJoinerForBodyNode() = default;
@@ -173,7 +173,7 @@ template <class Base1, class Base2, class... OtherBases>
173173
class NodeManagerJoinerForSkeleton<Base1, Base2, OtherBases...>
174174
: public NodeManagerJoinerForSkeleton<
175175
Base1,
176-
NodeManagerJoinerForSkeleton<Base2, OtherBases...> >
176+
NodeManagerJoinerForSkeleton<Base2, OtherBases...>>
177177
{
178178
public:
179179
NodeManagerJoinerForSkeleton() = default;

dart/dynamics/PointCloudShape.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -205,13 +205,13 @@ Eigen::Vector4d PointCloudShape::getOverallColor() const
205205
void PointCloudShape::setColors(
206206
const std::vector<
207207
Eigen::Vector4d,
208-
Eigen::aligned_allocator<Eigen::Vector4d> >& colors)
208+
Eigen::aligned_allocator<Eigen::Vector4d>>& colors)
209209
{
210210
mColors = colors;
211211
}
212212

213213
//==============================================================================
214-
const std::vector<Eigen::Vector4d, Eigen::aligned_allocator<Eigen::Vector4d> >&
214+
const std::vector<Eigen::Vector4d, Eigen::aligned_allocator<Eigen::Vector4d>>&
215215
PointCloudShape::getColors() const
216216
{
217217
return mColors;

dart/dynamics/SoftBodyNode.cpp

+9-9
Original file line numberDiff line numberDiff line change
@@ -1431,26 +1431,26 @@ SoftBodyNode::UniqueProperties SoftBodyNodeHelper::makeBoxProperties(
14311431

14321432
std::vector<PointPair> corners(nCorners);
14331433

1434-
std::vector<std::vector<PointPair> > edgeX(
1434+
std::vector<std::vector<PointPair>> edgeX(
14351435
4, std::vector<PointPair>(nVerticesAtEdgeX));
1436-
std::vector<std::vector<PointPair> > edgeY(
1436+
std::vector<std::vector<PointPair>> edgeY(
14371437
4, std::vector<PointPair>(nVerticesAtEdgeY));
1438-
std::vector<std::vector<PointPair> > edgeZ(
1438+
std::vector<std::vector<PointPair>> edgeZ(
14391439
4, std::vector<PointPair>(nVerticesAtEdgeZ));
14401440

1441-
std::vector<std::vector<PointPair> > sideXNeg(
1441+
std::vector<std::vector<PointPair>> sideXNeg(
14421442
nVerticesAtEdgeY, std::vector<PointPair>(nVerticesAtEdgeZ));
1443-
std::vector<std::vector<PointPair> > sideXPos(
1443+
std::vector<std::vector<PointPair>> sideXPos(
14441444
nVerticesAtEdgeY, std::vector<PointPair>(nVerticesAtEdgeZ));
14451445

1446-
std::vector<std::vector<PointPair> > sideYNeg(
1446+
std::vector<std::vector<PointPair>> sideYNeg(
14471447
nVerticesAtEdgeZ, std::vector<PointPair>(nVerticesAtEdgeX));
1448-
std::vector<std::vector<PointPair> > sideYPos(
1448+
std::vector<std::vector<PointPair>> sideYPos(
14491449
nVerticesAtEdgeZ, std::vector<PointPair>(nVerticesAtEdgeX));
14501450

1451-
std::vector<std::vector<PointPair> > sideZNeg(
1451+
std::vector<std::vector<PointPair>> sideZNeg(
14521452
nVerticesAtEdgeX, std::vector<PointPair>(nVerticesAtEdgeY));
1453-
std::vector<std::vector<PointPair> > sideZPos(
1453+
std::vector<std::vector<PointPair>> sideZPos(
14541454
nVerticesAtEdgeX, std::vector<PointPair>(nVerticesAtEdgeY));
14551455

14561456
Eigen::Vector3d x0y0z0

dart/dynamics/SpecializedNodeManager.hpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ DART_DECLARE_CLASS_WITH_VIRTUAL_BASE_END
113113
template <class SpecNode1, class... OtherSpecNodes>
114114
class BodyNodeSpecializedFor<SpecNode1, OtherSpecNodes...>
115115
: public NodeManagerJoinerForBodyNode<
116-
common::Virtual<BodyNodeSpecializedFor<SpecNode1> >,
117-
common::Virtual<BodyNodeSpecializedFor<OtherSpecNodes...> > >
116+
common::Virtual<BodyNodeSpecializedFor<SpecNode1>>,
117+
common::Virtual<BodyNodeSpecializedFor<OtherSpecNodes...>>>
118118
{
119119
};
120120

@@ -217,8 +217,8 @@ DART_DECLARE_CLASS_WITH_VIRTUAL_BASE_END
217217
template <class SpecNode1, class... OtherSpecNodes>
218218
class SkeletonSpecializedFor<SpecNode1, OtherSpecNodes...>
219219
: public NodeManagerJoinerForSkeleton<
220-
common::Virtual<SkeletonSpecializedFor<SpecNode1> >,
221-
common::Virtual<SkeletonSpecializedFor<OtherSpecNodes...> > >
220+
common::Virtual<SkeletonSpecializedFor<SpecNode1>>,
221+
common::Virtual<SkeletonSpecializedFor<OtherSpecNodes...>>>
222222
{
223223
};
224224

dart/dynamics/detail/BasicNodeManager.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ namespace detail {
5050
class BasicNodeManagerForBodyNode
5151
{
5252
public:
53-
using NodeMap = std::map<std::type_index, std::vector<Node*> >;
53+
using NodeMap = std::map<std::type_index, std::vector<Node*>>;
5454
using NodeDestructorSet = std::unordered_set<NodeDestructorPtr>;
55-
using NodeNameMgrMap = std::map<std::type_index, common::NameManager<Node*> >;
55+
using NodeNameMgrMap = std::map<std::type_index, common::NameManager<Node*>>;
5656
using SpecializedTreeNodes
5757
= std::map<std::type_index, std::vector<NodeMap::iterator>*>;
5858

dart/dynamics/detail/BodyNodeAspect.hpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -116,16 +116,16 @@ struct BodyNodeAspectProperties
116116

117117
//==============================================================================
118118
using NodeTypeStateVector
119-
= common::CloneableVector<std::unique_ptr<Node::State> >;
119+
= common::CloneableVector<std::unique_ptr<Node::State>>;
120120
using NodeStateMap
121-
= std::map<std::type_index, std::unique_ptr<NodeTypeStateVector> >;
121+
= std::map<std::type_index, std::unique_ptr<NodeTypeStateVector>>;
122122
using AllNodeStates = common::CloneableMap<NodeStateMap>;
123123

124124
//==============================================================================
125125
using NodeTypePropertiesVector
126-
= common::CloneableVector<std::unique_ptr<Node::Properties> >;
126+
= common::CloneableVector<std::unique_ptr<Node::Properties>>;
127127
using NodePropertiesMap
128-
= std::map<std::type_index, std::unique_ptr<NodeTypePropertiesVector> >;
128+
= std::map<std::type_index, std::unique_ptr<NodeTypePropertiesVector>>;
129129
using AllNodeProperties = common::CloneableMap<NodePropertiesMap>;
130130

131131
//==============================================================================
@@ -168,7 +168,7 @@ using BodyNodeCompositeBase = common::EmbedStateAndPropertiesOnTopOf<
168168
BodyNode,
169169
BodyNodeState,
170170
BodyNodeAspectProperties,
171-
common::RequiresAspect<NodeVectorProxyAspect> >;
171+
common::RequiresAspect<NodeVectorProxyAspect>>;
172172

173173
} // namespace detail
174174
} // namespace dynamics

dart/dynamics/detail/EndEffectorAspect.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ void SupportUpdate(Support* support);
9797

9898
using EndEffectorCompositeBase = CompositeNode<common::CompositeJoiner<
9999
FixedJacobianNode,
100-
common::SpecializedForAspect<Support> > >;
100+
common::SpecializedForAspect<Support>>>;
101101

102102
} // namespace detail
103103
} // namespace dynamics

0 commit comments

Comments
 (0)