Boost logo

Boost :

From: Gennaro Prota (gennaro_prota_at_[hidden])
Date: 2006-06-18 20:30:54


some misc, quick, comments about boost array:

* the current CVS version has the required partial specialization for
the case N==0; I haven't actually compiled it, but I suppose


should be closed.

* in the mentioned specialization (I haven't checked the primary
template, maybe there too), there are many repetitions of:

           return null_item();

Anywhere this is used the return type is either reference or
const_reference, so one could replace all of those occurrences with:

           return failed_function();

where failed_function() is defined as

           static reference failed_function()
               return null_item();

For additional safety, functions returning a const_reference ought to

           return static_cast<const_reference>(failed_function());

NOTE: Going a bit further null_item() is not necessary, as one could
use a return *(new T) directly in failed_range_check(), though I
haven't thought of all the consequences in the case operator new is

* why are the two operator[]() functions range-checked for the case
N==0? And what's the point of those BOOST_ASSERT( "out of range" )?


Boost list run by bdawes at, gregod at, cpdaniel at, john at