Solved

Porting old STL code to GCC4

Posted on 2008-06-09
2
369 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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
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…
Simple Linear Regression

622 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