C++11 g++ error: use of deleted function
<p>I have compilers:<br>
g++ (Ubuntu 4.8.4-2ubuntu1~14.04.1) 4.8.4<br>
Microsoft Visual Studio 2015 ver. 14.0. (Visual C++ 2015)</p>

<p>Source code:</p>

<pre><code>#include &lt;queue&gt;

class C
{
};


class B
{
public:
  // assignment and copy prohibited
  B(const B&amp;) = delete;
  B&amp; operator=(const B&amp;) = delete;

  B(int v1, int v2) : m_V1(v1), m_V2(v2) {}

private:
  int m_V1;
  int m_V2;
  std::queue&lt;C&gt; m_Queue;
};

class A
{
public:
  // assignment and copy prohibited
  A(const A&amp;) = delete;
  A&amp; operator=(const A&amp;) = delete;

  A(int p1, int p2) : arrB{ {p1+1, p2+2}, {p1+3, p2+4}, {p1+5, p2+6} } { }

private:
  B arrB[3];
};
</code></pre>

<p>1) If I use g++ with</p>

<pre><code>std::queue&lt;C&gt; m_Queue;
</code></pre>

<p>I get the following error:</p>

<pre><code>make
g++ -std=c++11 -c test.cpp
test.cpp: In constructor ‘A::A(int, int)’:
test.cpp:29:70: error: use of deleted function ‘B::B(const B&amp;)’
   A(int p1, int p2) : arrB{ {p1+1, p2+2}, {p1+3, p2+4}, {p1+5, p2+6} } { }
                                                                      ^
test.cpp:11:3: error: declared here
   B(const B&amp;) = delete;
   ^
make: *** [test.o] Error 1
</code></pre>

<p>2) If I use g++ and comment the line</p>

<pre><code>//std::queue&lt;C&gt; m_Queue;
</code></pre>

<p>or I use both variants (commented and not) with Microsoft Visual Studio 2015 I don't get any errors.</p>

<p>Why?</p>

<p><strong>Update:</strong><br>
List-initialization uses direct-list-initialization or copy-list-initialization.</p>

<blockquote>
  <p>8.5.4 List-initialization<br> 1 List-initialization is initialization of an object or reference from a braced-init-list. Such an initializer
  is called an initializer list, and the comma-separated
  initializer-clauses of the list are called the elements of the
  initializer list. An initializer list may be empty.
  List-initialization can occur in direct-initialization or
  copyinitialization contexts; list-initialization in a
  direct-initialization context is called direct-list-initialization and
  list-initialization in a copy-initialization context is called
  copy-list-initialization.</p>
</blockquote>

<p>But I do not understand what sort of initialization to be used in my case. I supposed that should be used direct-list-initialization in accordance with <a href="http://en.cppreference.com/w/cpp/language/list_initialization" rel="nofollow">http://en.cppreference.com/w/cpp/language/list_initialization</a></p>

<p><strong>Update 2:</strong></p>

<blockquote>
  <p>8.5.1 Aggregates [dcl.init.aggr]<br> 1 An aggregate is an array or a class (Clause 9) with no user-provided constructors (12.1), no private or
  protected non-static data members (Clause 11), no base classes (Clause
  10), and no virtual functions (10.3).</p>
  
  <p>When an aggregate is initialized by an initializer list, as specified
  in 8.5.4, the elements of the initializer list are taken as
  initializers for the members of the aggregate, in increasing subscript
  or member order. Each member is copy-initialized from the
  corresponding initializer-clause.</p>
</blockquote>

<p><strong>An aggregate is an array</strong> and <strong>Each member is copy-initialized</strong> - answer?<br>
But this does not explain why compiles without errors when commenting on the line:</p>

<pre><code>//std::queue&lt;C&gt; m_Queue;
</code></pre>