私はstd::unique_ptrと別の生ポインタを持っています。私は生ポインタがいかなる種類の所有権も持たずにunique_ptrの内容を指すようにしたい。読み取り専用の関係です: auto bar=std::make_unique<foo>();
auto ptr=bar.get();// This may point to another value later
これは悪いですか?何か
あなたはこの表に従ってunique_ptrデストラクタはTが完了する必要があり、前方宣言された型Tためunique_ptr<T>を使用しますが、移動代入演算子としても(とreset)、時: https://stackoverflow.com/a/6089065/1794803 ので、 class impl_t;
class A
{
std::unique_ptr<impl_t> p