Mentions légales du service

Skip to content

Update codebase to C++14

Created by: stephanemagnenat

The current Aseba codebase is mostly C++03. Recently, Aseba has been switched to C++14, and new code is expected to use the new C++14 features. Progressively, existing code should be migrated.

The following features should be used:

  • override: methods that override parent ones should explicitly state that through the override keyword.
  • noexcept: functions that are guaranteed not to return exception should state that through the noexcept keyword.
  • constexpr: objects and functions that can be const expressions should state that through the constexpr keyword.
  • autogenm: in interfaces with virtual destructors, when not manually specified, the following auto-generated members should be specified as default: copy constructor, copy assignment operator, move constructor, move assignment operator.
  • defval: when it makes sense, class members should be given default values to simplify the constructors.
  • usingalias: instead of typedef, keyword using should be for template aliasing.
  • enum: use strongly-typed enums whenever meaningful.
  • nullptr: use nullptr whenever a NULL pointer is used.
  • auto: use auto and range-based loops whenever it makes sense.
  • contstit: use const_iterator whenever possible, using cbegin() and cend().
  • array: use std::array instead of C arrays.
  • passbyvalue: when a constructor copies a variable into its own, pass by value and std::move.

The following code parts of Aseba must be updated:

  • common/
  • compiler/
  • transport/dashel_plugins
  • clients/studio
  • clients/thymioupgrader
  • clients/thymiownetconfig
  • other tools in clients/
  • switches
  • targets
  • examples