Solved

Porting old STL code to GCC4

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

This article will show, step by step, how to integrate R code into a R Sweave document
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.
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

758 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now