[std-interval] default constructor

Fernando Cacciola fernando_cacciola at datafull.com
Wed Apr 5 16:33:20 PDT 2006


Sylvain Pion wrote:
> Here is the summary of the various options I saw:
>
> 1- no default constructor at all
> 2- [0,0]
> 3- empty
> 4- whole
> 5- uninitialized tag
> 6- see below (something a la "singular iterator")
>
> ...
>
> Let me propose 6-:
>
> We can do something similar to the "singular values"
> of standard iterators.  That is, the default constructed
> value is considered "uninitialized", and the standard would
> only allow assignment on such an uninitialized value.
> Only assignment from a non-uninitialized interval makes
> it non-uninitialized.  And all other operations on
> uninitialized intervals have undefined behavior (which
> means everything can happen including WWIII).
>
> This way, we can simply use the default compiler-generated
> default constructor.

I like this.
It allows the implementation to deal with uninitialization in the best 
possible way given its particular target.

I wonder if, for all the other operations, unspecified behaviour isn't 
better than undefined behaviour?
An implementation will have to define this one way or another I think.

Fernando Cacciola
SciSoft
http://fcacciola.50webs.com/





More information about the Std-interval mailing list