On 14/06/2011 08:19, gwowen wrote:
On Jun 13, 2:35 pm, "Alf P. Steinbach /Usenet"<alf.p.steinbach
(e-mail address removed)> wrote:
To be fair, it just occurred to me, as an example, that we do say
"pointer to
array of pointers" and not "pointer to first element in an array of
pointers".
I don't know if anyone's ever suggested that's not a useful
colloquialism (well, Leigh maybe, but I wouldn't know).
I made it clear on multiple occasions that the phrases "pointer to" and
"points to" can mean different things *if* we are being less formal
(i.e. not technically accurate):
int* p = new int[42];
1) 'p' is a pointer to an 'int';
2) 'p' is not a pointer to an array of 'int';
3) 'p' points to the first element of an array of 'int'
4) 'p' points to an array of 'int'.
(1) and (2) both describe the *type* of 'p' whilst (3) and (4) describe
runtime properties (i.e. the *objects* pointed to).
If we are being more formal (i.e. technically accurate) then I would
consider (4) to be incorrect.
Enshrined in the coming Holy Standard (unless it's been changed?):
24.2.1
5 Just as a regular /pointer to an array/ guarantees that there
is a pointer value pointing past the last element of the array,
so for any iterator type there is an iterator value that points
past the last element of a corresponding sequence.
27.7.5
...
template<class charT> unspecified get_time(struct tm* tmb, const
charT* fmt);
7 Requires: The argument tmb shall be a valid pointer to an
object of type struct tm, and the argument fmt shall be a valid
/pointer to an array/ of objects of type charT with
char_traits<charT>::length(fmt) elements.
...
template<class charT> unspecified put_time(const struct tm* tmb,
const charT* fmt);
9 Requires: The argument tmb shall be a valid pointer to an
object of type struct tm, and the argument fmt shall be a valid
/pointer to an array/ of objects of type charT with
char_traits<charT>::length(fmt) elements.
lolz ... enjoy your flaming future Leigh.
KHD