C++ types Flashcards

1
Q

what is a std::shared_ptr?

A

A pointer that has (possibly shared) ownership of a n object. If the (last) shared pointer is deleted or goes out of scope, so is the object

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

should you use const std::string or const char*?

A

const char*, because it will implicitly be converted to const std::string if needed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly