Skip to content
This repository has been archived by the owner on Jan 5, 2021. It is now read-only.

Effective C++ comliant code - use initialisation list instead of assignments within the constructor #1633

Closed
rherrmannr opened this issue Sep 5, 2017 · 0 comments
Assignees
Milestone

Comments

@rherrmannr
Copy link
Contributor

rherrmannr commented Sep 5, 2017

Fix compiler warning:

Warning ... should be initialized in the member initialization list [-Weffc++]

Change constructor from
Default::Default(){ stateConvVectorPosition = 0 }

to

Default::Default():stateConvVector(0) {}

for all used variables.

see "Effective C++"
Item 4: Make sure that objects are initialized before they’re used.

@rherrmannr rherrmannr changed the title [-Weffc++] Effective C++ comliant code - use initialisation list instead of assignments within the constructor Effective C++ comliant code - use initialisation list instead of assignments within the constructor Sep 5, 2017
@rherrmannr rherrmannr self-assigned this Sep 5, 2017
@andreasmuelder andreasmuelder added this to the S41 milestone Sep 21, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants