Andre Poenitz a écrit :
-class ParagraphList : public std::vector<Paragraph>
+using namespace std;
Please no 'using' in headers.
Sure, this was just a quickly made proof of concept.
- ParagraphList::const_iterator p = par + 1;
+ ParagraphList::const_iterator p = par; p++;
Or 'p = boost::next(par)' ...
I don't see much the advantage but OK.
+const size_t VECTOR_RESERVE = 1000000;
Overkill. 10000 is more than anybody uses.
Note also that e.h. each table cell has a ParagraphList,
so for 50 x 50 table you'd reserve 2.5 * 10^9 items.
No good.
Use 100 or so for VECTOR_RESERVE _at max_. In fact, I do think
we should not reserve anything.
Make sense. OK.
+Paragraph& ParagraphList::get(size_t pos)
+{
+ BOOST_ASSERT(pos < PliVector_.size());
+ return *PliVector_[pos];
+}
Could that be called 'at(..)'?
Sure. This is more STLish indeed.
+
+size_t ParagraphList::size() const
+{
+ return PliVector_.size();
+}
+
+ParagraphList::const_iterator ParagraphList::begin() const
+{
+ return ParList_.begin();
+}
I'd guess most of these functions should be inline in the header.
When we decide on a final implementation yes.
+{
+ bool result=true;
+ for (size_t i=start; i<end; ++i)
bool result = true;
for (size_t i = start; i < end; ++i)
People are picky here ;-}
That picky? ;-)
Andre'
Thanks Andre,
Abdel.