Answers for "c++ const shared_ptr"

C++
9

c++ make shared_ptr

#include <memory>
std::shared_ptr<int> foo = std::make_shared<int> (10);
Posted by: Guest on January-23-2021
0

c++ const shared_ptr

shared_ptr<T> p;             ---> T * p;                                    : nothing is const
const shared_ptr<T> p;       ---> T * const p;                              : p is const
shared_ptr<const T> p;       ---> const T * p;       <=> T const * p;       : *p is const
const shared_ptr<const T> p; ---> const T * const p; <=> T const * const p; : p and *p are const.
Posted by: Guest on August-09-2021

Browse Popular Code Answers by Language