Solved

Porting old STL code to GCC4

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

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

Suggested Solutions

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
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.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

808 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