Changed bot concerns all classes exclusively use std::unique_ptr and "moved" the static_assert's (I commented them where they where)
Description
Description
Details
Details
- Provenance
Daniel Authored on May 31 2019, 10:46 AM dschnoell Pushed on May 31 2019, 10:51 AM - Parents
- R20:c8fee06db9c1: a bit more cleanup
- Branches
- Unknown
- Tags
Event Timeline
Comment Actions
Some suggestions about using unique_ptr...
/include/rosa/agent/CrossReliability.h | ||
---|---|---|
130 | When you take ownership of the pointer, either by release() like here or by moving the unique_ptr like in reliabilities, it would be better to take the parameter with move semantics (i.e., std::unique_ptr<Abstraction> &&Function) for the signature to indicate that the passed unique_ptr will not be usable after calling this function. | |
131 | I would like to advocate the use of unique_ptr instead of a raw pointer. I can see that the objects that are owned by raw pointers are deleted in the destructor properly. But should you use smart pointers instead, there would be no need to write a line of destructor as everything would be taken care of automatically when deleting the member fields. |