cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
initialize the smart pointer to nullptr
initialize the smart pointer to nullptr by default
Jul 16, 2015 at 11:19am UTC
sajis997
(109)
Hello,
I have the declared the vector of shared pointer as a member of the class.
Is it necessary to initialize the pointers to nullptr inside the constructor or they are taken care of by default ?
std::vector<std::shared_ptr<Triangle>> triangles_;
Jul 16, 2015 at 11:28am UTC
coder777
(8444)
smart_ptr will be nullptr by default.
Topic archived. No new replies allowed.