Date: 2006-12-18 10:47:44
From: Ion Gazta?aga <igaztanaga_at_[hidden]>
> To avoid wasting a bit of the internal
> size integer, we could define size() as "this->size_ - 1", so
> this->size_ == 0 could represent unknown size and this->size_== 1 an
> empty list, this->size_ == 2 a list with just 1 element and so on.
Clever, but such a design would fail code review if I were the project manager. This is way too likely to cause maintenance problems at some future time.
Better to save the bit by defining size_ == MAXINT as unknown size, and all other values as the actual size.
James Jones Administrative Data Mgmt.
Webmaster 375 Raritan Center Pkwy, Suite A
Data Architect Edison, NJ 08837
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk