title: how to emplace_back(pair) efficiently?
body: <p>I have</p>
  
  <pre><code>using namespace std;   // for convenience in SO question only
  vector&lt;pair&lt;array&lt;int,3&gt;, int&gt;&gt; foo;
  </code></pre>
  
  <p>and want to <code>emplace_back</code> an element with <code>pair::first</code> holding <code>{i,j,k}</code> and <code>pair::second</code> holding <code>q</code>. The only way I could get this compiling was with the rather clumsy</p>
  
  <pre><code>foo.emplace_back(piecewise_construct,
                   forward_as_tuple(i,j,k),
                   forward_as_tuple(q));
  </code></pre>
  
  <p>Is this efficient (i.e. is it <em>guaranteed</em> that the <code>tuple</code>s will be optimised away)? Or is there another way that is <em>guaranteed</em> efficient?</p>
  
  <p>(I tried</p>
  
  <pre><code>foo.emplace_back(std::initializer_list&lt;int&gt;{i,j,k}, q);
  </code></pre>
  
  <p>but to no avail with gcc 4.8.1). I know that I can avoid this problem by defining </p>
  
  <pre><code>struct element : std::pair&lt;std::array&lt;int,3&gt;,int&gt;
  {
    element(int i, int j, int k, int q)
    { first={i,j,k}; second=q; }
  };
  
  vector&lt;element&gt; foo;
  foo.emplace_back(i,j,k,q);
  </code></pre>
  
  <p>but I'd prefer to do without such extra code.</p>