TS
Size: a a a
TS
TS
W
std::experimental::propagate_const
.SP
AK
PZ
std::experimental::propagate_const
.template<typename T>
struct PropagateConst
{
using Type = typename T::element_type;
PropagateConst(T&& ptr) : x(std::forward<T>(ptr)) {}
const Type* operator->() const
{
return static_cast<const Type*>(x.operator->());
}
Type* operator->()
{
return x.operator->();
}
T x;
};
FO
W
template<typename T>
struct PropagateConst
{
using Type = typename T::element_type;
PropagateConst(T&& ptr) : x(std::forward<T>(ptr)) {}
const Type* operator->() const
{
return static_cast<const Type*>(x.operator->());
}
Type* operator->()
{
return x.operator->();
}
T x;
};
PZ
АК
const unique_ptr<T>
не обязан работать как unique_ptr<const T>
W
propagate_const<unique_ptr<T>>
AK
D
D
ИО
SP
ИО
IV
ИМ
ИО