为什么不能在 C++ 中创建一个包含一个元组和一个 unique_ptr 作为值的元组?

J.D*_*Doe 5 c++ pointers stl unique-ptr stdtuple

把一个std::unique_ptr内部std::tuple工作没有任何问题,但是当tuple包含另一个tuple具有共同unique_ptr的元素,则编译器会引发错误。

例子:

    std::tuple<int, std::unique_ptr<Entity>> tupleA {1, std::move(new Entity)};

    //this line throws an error!
    std::tuple<std::tuple<int, int>, std::unique_ptr<Entity>> tupleB {{1, 1}, std::move(new Entity)};
Run Code Online (Sandbox Code Playgroud)
第二行,创建 `tupleB` 抛出以下错误:
        error: no matching constructor for initialization of ´std::tuple<std::tuple<int, int>,std::unique_ptr<Entity>>´
        note: candidate constructor template not viable: cannot convert initializer list argument to ´std::allocator_arg_t´
Run Code Online (Sandbox Code Playgroud)

这里的问题究竟是什么?