allocator size_type

Discussion in 'C++' started by Fraser Ross, Jul 31, 2003.

  1. Fraser Ross

    Fraser Ross Guest

    If anyone has the book Effective STL do you agree that the word value should
    be type on P51, 2nd paragraph from the bottom, in the sentence starting 'In
    both cases'. allocator's size_type is required to be size_t so why say it
    is typically a typedef for size_t?

    Fraser.
     
    Fraser Ross, Jul 31, 2003
    #1
    1. Advertisements

  2. "Fraser Ross" <fraserATmembers.v21.co.unitedkingdom> wrote in message
    news:...
    > If anyone has the book Effective STL do you agree that the word value

    should
    > be type on P51, 2nd paragraph from the bottom, in the sentence starting

    'In
    > both cases'. allocator's size_type is required to be size_t so why say it
    > is typically a typedef for size_t?
    >
    > Fraser.
    >


    I don't have the book, but allocator's size_type is required to be size_t
    only in a STL compatible allocator. It isn't required to be size_t in
    general. Of course this begs the question of what would be the point of a
    non-STL compatible allocator.

    john
     
    John Harrison, Jul 31, 2003
    #2
    1. Advertisements

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. Kevin Goodsell

    size_type requirements

    Kevin Goodsell, Sep 12, 2003, in forum: C++
    Replies:
    1
    Views:
    591
    Josh Sebastian
    Sep 13, 2003
  2. Alex J. Dam

    size_type, pos_type, etc.

    Alex J. Dam, Jan 26, 2004, in forum: C++
    Replies:
    6
    Views:
    5,914
    Ron Natalie
    Jan 27, 2004
  3. Denis Remezov

    size_t and size_type

    Denis Remezov, Apr 1, 2004, in forum: C++
    Replies:
    9
    Views:
    19,690
    Pete Becker
    Apr 3, 2004
  4. Aaron
    Replies:
    6
    Views:
    1,560
  5. Eric Lilja
    Replies:
    3
    Views:
    1,071
    Eric Lilja
    Apr 23, 2005
  6. Frederick Ding

    why always out_of_range using size_type?

    Frederick Ding, May 7, 2005, in forum: C++
    Replies:
    4
    Views:
    616
    Ron Natalie
    May 7, 2005
  7. Replies:
    2
    Views:
    593
  8. asdf
    Replies:
    2
    Views:
    416
    Bo Persson
    Sep 16, 2006
Loading...