Solved

Porting old STL code to GCC4

Posted on 2008-06-09
2
368 Views
Last Modified: 2013-11-13
Is there an easy way to port this code to gcc4. It uses old obsolete STL templates which do not longer exist in the new version:

 template<typename _Tp, bool __threads, int __inst>
    struct _Alloc_traits<_Tp, MyAlloc_template<__threads, __inst> >
    {
      static const bool _S_instanceless = true;
      typedef __simple_alloc<_Tp, MyAlloc_template<__threads, __inst> >
        _Alloc_type;
      typedef __allocator<_Tp, MyAlloc_template<__threads, __inst> > allocator_type;
    };

_Alloc_traits, __simple_alloc and __allocator do no longer exist.

It would be great If anyone could help

Thanx in advance
0
Comment
Question by:joshka
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 39

Accepted Solution

by:
itsmeandnobodyelse earned 500 total points
ID: 21754150
>>>> It uses old obsolete STL templates

If you port code written with STL you may *NOT* port the STL headers, *BUT* only your code which uses the STL classes and functions. You have to use the STL which fits to the compiler (not porting the STL). If doing so, there should be only a few parts which don't compile, e. g. code using iterators where major changes may have occured. You can post these errors and we should be able to help you for each of these issues.
0
 

Author Comment

by:joshka
ID: 21757608
Sorry, if my first post was misleading but this code above is not from the STL but uses STL templates from gcc3.3 which are no longer in gcc4. This code is not from STL classes but from the program I am trying to port. I not meant to port the STL, only want to make this piece of code from gcc3 work in gcc4 where Alloc_traits are no longer available.

Thanks
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is an explanation of a simple data model to help parse a JSON feed
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question