Add extra warning about using brace initialization on json when we shouldn't.

This commit is contained in:
Stephen Anthony 2022-06-04 11:53:28 -02:30
parent 496848d3a3
commit eb6d854599
2 changed files with 10 additions and 0 deletions

View File

@ -14,6 +14,12 @@
6.6 to 6.7 (June 6, 2022)
* IMPORTANT NOTES:
- Because of fixes to JSON handling, all remappings will be reset
to defaults; if you had custom mappings, they will need to be
re-entered again.
- Because of internal changes, all state files are now invalid.
* Completely reworked the file launcher:
- Redesigned user interface
- Added tracking of user favorites, recently played and most popular

View File

@ -49,6 +49,10 @@ class PhysicalJoystickHandler
private:
struct StickInfo
{
// NOTE: For all future linting exercises
// Make sure to *NEVER* use brace initialization or std::move
// on the 'mapping' instance variable; there lay dragons ...
// https://json.nlohmann.me/home/faq/#brace-initialization-yields-arrays
explicit StickInfo(nlohmann::json map, PhysicalJoystickPtr stick = nullptr)
: mapping(map), joy{std::move(stick)} {}