Re: FAQ 34.3

Discussion in 'C++' started by Andrey Tarasevich, Jul 24, 2003.

  1. Agent Mulder wrote:
    > ...
    > However v.begin() is not guaranteed to be a T*, which means v.begin() is not
    > guaranteed to be the same as &v[0]:
    >
    > My question is, why is v.begin() not guaranteed to be of T* ?
    > ...


    Why should it be guaranteed? It is always better to stick with less
    restrictive specification, as long as it satisfies you requirements. In
    this particular case the less restrictive specification would be
    declaring that 'v.begin()' return an iterator (which could be a pointer
    or something completely different). One benefit of doing it this way
    that this specification allows debugging implementations, where returned
    iterator would support range checking and other things of that nature.
    It wouldn't be possible if C++ required 'v.begin()' to return a pointer.

    --
    Best regards,
    Andrey Tarasevich
    Brainbench C and C++ Programming MVP
     
    Andrey Tarasevich, Jul 24, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Anand N [MVP]

    C# FAQ 1

    Anand N [MVP], Sep 18, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    661
    Anand N [MVP]
    Sep 19, 2004
  2. =?ISO-8859-15?Q?Juli=E1n?= Albo

    FAQ or not FAQ?

    =?ISO-8859-15?Q?Juli=E1n?= Albo, Jan 8, 2007, in forum: C++
    Replies:
    28
    Views:
    940
    Grizlyk
    Jan 15, 2007
  3. Josef 'Jupp' Schugt
    Replies:
    0
    Views:
    248
    Josef 'Jupp' Schugt
    Sep 22, 2003
  4. FAQ server

    FAQ - How do I direct someone to this FAQ?

    FAQ server, Aug 4, 2006, in forum: Javascript
    Replies:
    1
    Views:
    192
    Dr John Stockton
    Aug 4, 2006
  5. Peter Michaux

    FAQ/FAQ notes site makeover

    Peter Michaux, Nov 22, 2006, in forum: Javascript
    Replies:
    22
    Views:
    397
    Randy Webb
    Nov 27, 2006
Loading...

Share This Page