Why std::queue requires the element to be default constructible?

后端 未结 0 1721
无人及你
无人及你 2020-12-03 07:17

In the code below std::deque compiles, but std::queue does not:

class A
{
public:

    explicit A(int a) : m_a(a)
    {
        ++co         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题