http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38265

--- Comment #13 from Jonathan Wakely <redi at gcc dot gnu.org> ---
The C++11 standard clarifies that this is intended to work. The range
constructors require the type to be EmplaceConstructible into the container
from the iterator's value_type, which means calling
allocator_traits<A>::construct with the iterator's value type. For
std::allocator that is a call to placement new using direct-initialization
which means explicit constructors are viable.

If you don't want the explicit constructor to be viable then you need to use a
custom allocator which does something different.

(In reply to konto.dydaktyczne from comment #3)
>            [sequence containers]
>       std::vector -> no error signaled, "explicit" ignored
>       std::list   ->    error signaled, because of "explicit"

This now compiles in C++11 mode.

>       std::deque  -> no error signaled, "explicit" ignored  
> 
>            [associative containers]
>       std::set    ->    error signaled, because of "explicit"

This still fails, at a different place, but I think it should compile.

Reply via email to