|
|||
|
David Abrahams wrote:
> "Raoul Gough" <RaoulGough@yahoo.co.uk> writes: > > > Hmmm, never thought about doing it that way - the STL containers all > > separate front() and pop_front() into two distinct functions to avoid > > the exception safety problems. At least, I seem to remember reading > > that that was the reason for separating them. > > No, they were just naturally written that way. Exception-safety came > later. Wasn't Tom Cargill's article published in 1994 and the STL written in 1995? http://www.awprofessional.com/conten...g_Article.html [ See http://www.gotw.ca/resources/clcm.htm for info about ] [ comp.lang.c++.moderated. First time posters: Do this! ] |
|
|
||||
|
||||
|
|
|
|||
|
"Peter Dimov" <pdimov@gmail.com> writes:
> David Abrahams wrote: >> "Raoul Gough" <RaoulGough@yahoo.co.uk> writes: >> >> > Hmmm, never thought about doing it that way - the STL containers all >> > separate front() and pop_front() into two distinct functions to avoid >> > the exception safety problems. At least, I seem to remember reading >> > that that was the reason for separating them. >> >> No, they were just naturally written that way. Exception-safety came >> later. > > Wasn't Tom Cargill's article published in 1994 and the STL written in > 1995? > > http://www.awprofessional.com/conten...g_Article.html I don't understand the relevance of Tom Cargill's article. The article provided precious little insight into how to deal with exceptions. It describes a bunch of problems, and then, essentially, throws up its hands. Cargill certainly doesn't suggest that any problems could be solved by changing the pop() interface. Many people have read that article to mean that it might not be possible to write exception-safe code at all, and the STL was initially written with no regard given to exception safety. Exception safety for the STL, as I wrote, came later. -- Dave Abrahams Boost Consulting www.boost-consulting.com [ See http://www.gotw.ca/resources/clcm.htm for info about ] [ comp.lang.c++.moderated. First time posters: Do this! ] |
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|