Collection of inconsistencies after initial assessment incl. potential for modernization
Dear all,
This issue is a container for all the little changes I would like to propose or discuss after my initial assessment of the code base.
-
IsEqual
is notnoexcept
, but used innoexcept
func, see floating_point_helper.h:40 -
add override
keyword, e. g. i_entity.h:101,107 -
add closing comments on namespaces, e. g. orientation.h:32 -
discuss include style ""
vs.<>
-
discuss ostream operators for all types -
discuss the rule of three/five/zero, e. g. i_geometry_helper.h:28, see The rule of three/five/zero and C.21: If you define or =delete any copy, move, or destructor function, define or =delete them all -
discuss trailing return type -
fix/explain IControllerConfig
copy ctor (std::make_unique
on raw pointer intostd::vector<std::shared_ptr<>>
) -
fix var and param naming, e. g. poly_line.h:36 -
harmonize enum class defs, e. g. weather.h
vs.control_strategy.h
vs.entity_properties.h
-
harmonize operator defs (some are friends, some are members etc.) -
if possible, use constexpr
for operators, e. g. orientation.h:84 -
improve floating point comparison, see Comparing Floating Point Numbers, 2012 Edition -
include what you use, e. g. time_utils.h
is missing#include <chrono>
-
introduce nodiscard
keyword, e. g. i_geometry_helper.h:37 -
introduce ClangTidy, see #6 (closed) and !7 (closed) -
Move SetSpeed
toIEntity
, see #8 -
reduce dir depth (move include
andtest
to root dir) -
reduce magic numbers, e. g. road_condition.h:32 -
reduce using directives, see #5 (closed) -
remove superfluous ctors, e. g. vector.h:27,29 -
remove superfluous default init values, e. g. i_controller_config.h:46 -
use = default
for ctors/dtors, e. g. i_controller_config.h:46 -
use auto
, apply AAA rule, see GotW #94 Special Edition: AAA Style (Almost Always Auto) -
use std::tie
for comparison, e. g. entity_properties.h:168 -
use using
instead oftypedef
, e. g. orientation.h:31
After discussion, this issue can be split into smaller chunks for resolution.
Regards, Martin
Martin Stump martin.stump@mercedes-benz.com on behalf of Mercedes-Benz Tech Innovation GmbH, Provider Information
Edited by Martin Stump