Am 24.04.2012 20:03, schrieb Akira Takahashi:
> I read N3337's Container adaptors specification.
> I think missing support operation : emplace_back().
>
> 23.6.3.1 queue definition
> Any sequence container supporting operations front(), back(),
> push_back() and pop_front() can be used to instantiate queue.
>
> => add emplace_back().
>
>
> 23.6.4 Class template priority_queue
> Any sequence container with random access iterator and supporting
> operations front(), push_back() and pop_back() can be used to
> instantiate priority_queue.
>
> => add emplace_back().
>
>
> 23.6.5 Class template stack
> Any sequence container supporting operations back(), push_back() and
> pop_back() can be used to instantiate stack.
>
> => add emplace_back().
I agree that adding these would seem to be more appropriate, even though
the current state does not really look like a defect to me, because
above quoted parts are more like introductory descriptions, not strong
requirements (but the latter following argumentation of mine is moving
slightly on this position). Strictly speaking, not even front() or
push_back (for example) are necessary when such a *container* adaptor is
instantiated.
Based on the same arguments you could argue that you need to add
operator<,>,<=, and>= as well, which are (now) optional as well.
I tend to say that the current wording state is better than adding these
or even further requirements because this would invalidate *existing*
user-provided C++03 sequence containers to be adapted. Consider a very
strict library implementation which considers these wordings as binding
requirements: It might add static assertions to the class body of these
adaptors to ensure that above functions exist: It would be a bad idea to
break existing adaptions that do not provide these functions.
Just my opinion - HTH& Greetings from Bremen,
Daniel Krügler