Closed yanwei1983 closed 1 year ago
Interesting, the problem boils down to this:
using value_t = std::deque<std::unique_ptr<uint32_t>>;
using pair_t = std::pair<uint32_t, value_t>;
auto v = std::vector<pair_t>{};
v.reserve(100); // compile error
So the problem is this doesn't work for a vector with a pair that has a deque with unique_ptr...
I'm sorry, there's nothing I can do here. This seems to be a defect in the C++ stdlib. std::deque
is not required that move constructor is noexcept
, and for some reason using it as part of a std::pair
causes this to fail.
I'm using an std::vector
as the base for unordered_map
, so this simply can't work.
i change the value_t , it succ
struct value_t : public std::deque<std::unique_ptr<uint32_t>>
{
value_t(value_t&&) noexcept = default;
};
thanks
Ha, that's a nice workaround!
Describe the bug can't compiler with T=std::deque<std::unique>
To Reproduce