473,385 Members | 1,333 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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

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
Jul 19 '05 #1
2 4403
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)
Jul 19 '05 #2
in**@oop-trainer.de (Ralf Schneeweiß) wrote in message news:<a6**************************@posting.google. com>...
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
Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: madmanahong | last post by:
I Found new & delete of the CRT was very slow. so I overloaded the global new & delete operator. but if the CRT & STL also use my new & delete operator. It's bad because then my overloaded...
1
by: sharmadeep1980 | last post by:
Hi All, I am facing a very unique problem while compling my project in "Release" build. The project is building in DEBUG mode but giving linking error on Release build. Here is the error:...
1
by: xqxu.pzhou | last post by:
I wrote a simple allocator "myAlloc" under the g++ 3.2.3. When it is used by Vector, it works well. But when it is used by List, the codes have errors when compling. the error message is: "no...
2
by: ranin02 | last post by:
Hi, We have a list derived from std::list that has a custom allocator derived from std::allocator. This was originally written using VC++ 6.0 which required a workaround for the fact that 6.0...
3
by: Mike | last post by:
Hi, I have a simple "memPool' class that simply maintains a linked list of chunks from which allocation requests are made. The whole thing is deleted all at once upon destruction. So far, so...
0
by: Juha Nieminen | last post by:
I wrote this allocator which you can use with std::list, std::set and std::map (cannot be used with std::vector nor std::deque, but that doesn't matter because there would be no benefits with...
6
by: Paavo Helde | last post by:
Juha Nieminen <nospam@thanks.invalidwrote in news:47f91b3c$0$8161 $4f793bc4@news.tdc.fi: I would guess that most speedup comes from the fact that the general allocator is thread-safe and yours...
6
by: Juha Nieminen | last post by:
I tested the speed of a simple program like this: //------------------------------------------------------------ #include <list> #include <boost/pool/pool_alloc.hpp> int main() { typedef...
3
by: maneshborase | last post by:
Hi friends, I am facing one serious problem in my application. I am trying to open dicom image file (.dcm) has size around 400 MB. But I am getting and unhandy exceptions, Some time, ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.