|
Boost : |
From: Oleg Abrosimov (olegabr_at_[hidden])
Date: 2007-08-16 11:16:09
Hello,
I don't have time for the full review, sorry.
Just one bug report to help you:
// Step 2: append the person to the m_persons.
m_persons.push_back(person);
BOOST_SCOPE_EXIT( (commit)(m_persons) )
{
if(!commit)
m_persons.pop_back();
} BOOST_SCOPE_EXIT_END
The standard in section 23.1 "Container requirements" says that:
"if an exception is thrown by a push_back() or push_front() function,
that function has no effects"
it means that the code above is buggy - in a case of exception in a copy
constructor of Person it removes one element from a container. In other
words, if before push_back m_persons.size() was 1, after scope_exit body
execution m_persons.size() == 0.
I'm not sure if I can vote with such a little effort involved, but if I
could, I vote to accept this library into boost.
Best regards,
Oleg Abrosimov
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk