How to write an allocator for the STL List in VC++ 6.0

Discussion in 'C++' started by =?ISO-8859-1?Q?Ralf_Schneewei=DF?=, Aug 20, 2003.

  1. Hi,
    there is a book from Andre Wilms describing how to write allocators
    for STL containers. Unfortunately the MS VC++ Compiler is not
    supporting the full ANSI standard in the template part of the C++
    programming language. This is the reason why the implementation
    proposal of Wilms is not working with this compiler.
    Is there anyone who knows a implementation proposal for an allocator
    working with VC++?

    Thanks

    Ralf Schneeweiß

    http:/www.oop-trainer.de
    =?ISO-8859-1?Q?Ralf_Schneewei=DF?=, Aug 20, 2003
    #1
    1. Advertising

  2. =?ISO-8859-1?Q?Ralf_Schneewei=DF?=

    Pete Becker Guest

    Ralf Schneeweiß wrote:
    >
    > Hi,
    > there is a book from Andre Wilms describing how to write allocators
    > for STL containers. Unfortunately the MS VC++ Compiler is not
    > supporting the full ANSI standard in the template part of the C++
    > programming language. This is the reason why the implementation
    > proposal of Wilms is not working with this compiler.
    > Is there anyone who knows a implementation proposal for an allocator
    > working with VC++?
    >


    You need to provide a function named _Charalloc, because VC6 can't
    handle the nested template that's used to rebind an allocator<T> to an
    allocator<U>. Take a look at the VC++ header <xmemory> to see what
    _Charalloc looks like.

    --

    Pete Becker
    Dinkumware, Ltd. (http://www.dinkumware.com)
    Pete Becker, Aug 21, 2003
    #2
    1. Advertising

  3. (Ralf Schneeweiß) wrote in message news:<>...
    > Hi,
    > there is a book from Andre Wilms describing how to write allocators
    > for STL containers. Unfortunately the MS VC++ Compiler is not
    > supporting the full ANSI standard in the template part of the C++
    > programming language. This is the reason why the implementation
    > proposal of Wilms is not working with this compiler.
    > Is there anyone who knows a implementation proposal for an allocator
    > working with VC++?


    (a) This is an ISO C++ newsgroup; Visual C++ questions like this one
    would best be directed to a Visual C++ newsgroup (e.g.,
    comp.os.ms-windows.programmer.*).

    (b) If you open the header file "memory" in your Visual C++ include
    directory (e.g., c:\program files\microsoft visual
    studio\vc98\include), you will find that it refers to another header
    ("xmemory") in the same directory. In that file is defined the MSVC++6
    allocator class. Just re-implement its interface.

    - Shane
    Shane Beasley, Aug 21, 2003
    #3
    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. Dan
    Replies:
    0
    Views:
    455
  2. Brian Genisio
    Replies:
    12
    Views:
    7,961
    tom_usenet
    Jan 15, 2004
  3. Scott Brady Drummonds

    STL v. Norma" Memory Allocator

    Scott Brady Drummonds, Jan 30, 2004, in forum: C++
    Replies:
    5
    Views:
    687
    tom_usenet
    Feb 2, 2004
  4. Mark P
    Replies:
    3
    Views:
    465
    Victor Bazarov
    Apr 5, 2005
  5. Mike
    Replies:
    3
    Views:
    842
Loading...

Share This Page