の値型である必要がある特定の型に対して、移動コンストラクター(コピーコンストラクターなし)を実装したいと思いますboost::unordered_map
。このタイプを呼びましょうComposite
。
Composite
次の署名があります。
struct Base
{
Base(..stuff, no default ctor) : initialization list {}
Base(Base&& other) : initialization list {}
}
struct Composite
{
Base member;
Composite(..stuff, no default ctor) : member(...) {}
Composite(Composite&& other) : member(other.member) {} // <---- I want to make sure this invokes the move ctor of Base
}
これを書きたいのでboost::unordered_map< Key , Composite >
、コピーコンストラクターは必要なく、移動コンストラクターを使用します。Base
可能であれば、のmoveコンストラクターの初期化リストでのcopyコンストラクターを使用したくありませんComposite
。
これは可能ですか?