Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Porting old STL code to GCC4

Posted on 2008-06-09
2
Medium Priority
?
374 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 2000 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] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

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

In this post we will learn different types of Android Layout and some basics of an Android App.
What do responsible coders do? They don't take detrimental shortcuts. They do take reasonable security precautions, create important automation, implement sufficient logging, fix things they break, and care about users.
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.
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…

972 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