Topic: lib.storage.iterator


Author: ncm@netcom.com (Nathan Myers)
Date: 1995/05/11
Raw View
In article <3opjel$ppq@news.csie.nctu.edu.tw>,
Hung-Chai Info Company <whtang@monica> wrote:
>Is it something wrong?
>
>  raw_storage_iterator<OutputIterator, T> &operator*();
>  in raw_storage_iterator class (20 14, 20.4.2, [lib.storage.iterator]).
>
>  T &operator*();
>[would be more] reasonable.

This is another good question.

The definition in the Draft looks odd, but it's correct.
To see why, try applying the expressions defined in the
table of valid operations on Output Iterators to a raw
storage iterator.  The right thing happens.

If operator*() returned a T&, it would actually refer to
uninitialized storage, and the T::operator= would have unknown effect.

Nathan Myers
myersn@roguewave.com





Author: whtang@monica (Hung-Chai Info Company)
Date: 1995/05/10
Raw View
Is it something wrong?

raw_storage_iterator<OutputIterator, T> &operator*();
in raw_storage_iterator class (20 14, 20.4.2, [lib.storage.iterator]).

T &operator*();
It will be reasonable.

whtang@dblab.cs.nchu.edu.tw