Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| From | Daniel Krügler<daniel.kruegler@googlemail.com> |
|---|---|
| Newsgroups | comp.std.c++ |
| Subject | Re: Container adaptor - missing container support operation |
| Date | 2012-04-25 13:56 -0700 |
| Organization | A noiseless patient Spider |
| Message-ID | <jn6re6$drk$1@dont-email.me> (permalink) |
| References | <60068140-4f4a-434e-af9d-d6391c284fb8@g6g2000pbq.googlegroups.com> |
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 -- [ comp.std.c++ is moderated. To submit articles, try posting with your ] [ newsreader. If that fails, use mailto:std-cpp-submit@vandevoorde.com ] [ --- Please see the FAQ before posting. --- ] [ FAQ: http://www.comeaucomputing.com/csc/faq.html ]
Back to comp.std.c++ | Previous | Next — Previous in thread | Next in thread | Find similar
Container adaptor - missing container support operation Akira Takahashi <faithandbrave@gmail.com> - 2012-04-24 11:03 -0700
Re: Container adaptor - missing container support operation Daniel Krügler<daniel.kruegler@googlemail.com> - 2012-04-25 13:56 -0700
Re: Container adaptor - missing container support operation Jason McKesson<jmckesson@gmail.com> - 2012-04-25 13:56 -0700
Re: Container adaptor - missing container support operation Akira Takahashi<faithandbrave@gmail.com> - 2012-04-26 11:07 -0700
Re: Container adaptor - missing container support operation "Nevin \":-]\" Liber" <nevin@eviloverlord.com> - 2012-04-25 15:44 -0700
Re: Container adaptor - missing container support operation Jason McKesson<jmckesson@gmail.com> - 2012-04-26 11:07 -0700
Re: Container adaptor - missing container support operation Akira Takahashi <faithandbrave@gmail.com> - 2012-04-27 11:12 -0700
csiph-web