What is the difference betwwen the older alloctaor::construct and the new one and explicit constructor? : <p>As I know <code>std::allocator&lt;T&gt;::construct</code> takes only two parameters on older version of C++; the first is a pointer to raw, un-constructed memory in which we want to construct an object of type <code>T</code> and the second one is a value of element type to initialize that object. So the copy-constructor is invoked:</p>

<pre><code>struct Foo {
    Foo(int, int) { cout &lt;&lt; "Foo(int, int)" &lt;&lt; endl; }
    /*explicit*/ Foo(int) { cout &lt;&lt; "Foo(int)" &lt;&lt; endl; }
    Foo(const Foo&amp;) { cout &lt;&lt; "Foo(const Foo&amp;)" &lt;&lt; endl; }
};

int main(int argc, char* argv[]) {


    allocator&lt;Foo&gt; a;
    Foo* const p = a.allocate(200, NULL); // second parameter is required on C++98 but on C++11 it is optional
//  Foo* const p = a.allocate(200); // works fine on C++11 but not on C++98

    a.construct(p, 5, 7); // works on C++ 11 and up but not C++98
    a.construct(p, 10);// works on both
    a.destroy(p);
    a.destroy(p + 1);
    a.deallocate(p, 200);



    std::cout &lt;&lt; std::endl;
}
</code></pre>

<ul>
<li><p>Why on C++98 <code>a.construct(p, 10)</code> calling the copy constructor but on C++11 and above is calling just the constructor that takes an integer?</p></li>
<li><p>Does this mean on C++ 11 because of some Copy-elision optimization even if the constructor <code>Foo(int)</code> is <code>explicit</code> works on such call: <code>a.construct(p, 5)</code> works on C++11 even the constructor is <code>explicit</code> what I am sure of is it doesn't works on C++98 if <code>Foo(int)</code> is <code>explicit</code>.</p></li>
<li><p>If so then if I compile that statement with some sort of disabling <code>copy-elision</code> optimization will cause the compiler fail? Thank you.</p></li>
</ul>
