I need a List/Chart that list "old headers" and "new headers" that they are replaced with.

Hello,

I installed 32bit G++ and GCC from Mingw-64 Version 6.0.0.
I have some old code I need to compile, modify compile, then rewrite compile.

I need a List/Chart that has all of the "old headers" and the "new headers" that they are replaced with.

Example:

old/obsolete current/new
<strstrea.h> <stream>

Does anyone know where I could find that information?
I tried searching google, but no luck.

Thank You for your time.
B.
Hello bteddy,

For a start you could try the reference section here. It is in the upper left corner under the heading "C++". You could also try https://en.cppreference.com/w/

Andy
Thank You, but unfortunately neither states:

old/obsolete/deprecated use this instead new/current/relevant

I am a first time user. Never touched it before. So, I don't know the proper terminology.
So, I may not be asking correctly.

I am assuming that G++ and GCC from Mingw-64 Version 6.0.0. is based on C++ 17.

I read somewhere that some of the headers were consolidated. So, instead of a one to one on all the headers there would be a few that go from many( old) to one(new).

That's way I am asking for something like:

This new "header name w" replaces old "header w"
This new "header name d" replaces old "header a and header b and header c"

OR

Old "header a" replaced by new "header a"
Old "header b" replaced by new "header a"
Old "header c" replaced by new "header c"
Old "header d" replaced by new "header e"
Old "header e" replaced by new "header a"
Old "header f" replaced by new "header e"

Any ideas where I may find this or maybe who to ask?


Hello bteddy,

I understand what you are looking for, but I have not seen or heard of anything like what you are looking for.

Most of what I know has come from reading what I can here.

Someone else might know something if they read this thread.

Andy
I am a first time user.

Then where are you seeing #includes like <<strstrea.h>?

If you're just learning the language you should be writing your own code based on modern C++, not pre-standard C++. That header was never a "standard" header and has been obsolete since the first version of the C++ standard (C++98).
There are not that many replacements.
I was going to write a list, but I wanted to work from a table; I'll just share the whole table.

- If you see C equivalent headers, you should change it to the C++ header.
- Where the functionality provided by certain headers should replace (or be replaced by) entirely different functionality, I've made a note on the far right. Hopefully I am not missing too much.

I've had to compress this a lot to post it, so please follow this link instead, if you can:
https://mbozzi.com/headers.html

The info comes straight from https://en.cppreference.com/w/cpp/header , except for the Notes column, which is mine.

   C equivalent	   C++ header		   Since    Depr.    Until  Notes						      

		   `<concepts>'		   /C++20/									      
   `<stdlib.h>'	   `<cstdlib>'												      
   `<signal.h>'	   `<csignal>'												      
   `<setjmp.h>'	   `<csetjmp>'					    Prefer other solutions, e.g, coroutines, exceptions	      
   `<stdarg.h>'	   `<cstdarg>'					    Prefer built-in variadic templates			      
		   `<typeinfo>'												      
		   `<typeindex>'	   /C++11/									      
		   `<type_traits>'	   /C++11/									      
		   `<bitset>'												      
		   `<functional>'											      
		   `<utility>'												      
   `<time.h>'	   `<ctime>'					    Prefer the functionality in `<chrono>'		      
		   `<chrono>'		   /C++11/									      
   `<stddef.h>'	   `<cstddef>'												      
		   `<initializer_list>'	   /C++11/									      
		   `<tuple>'		   /C++11/									      
		   `<any>'		   /C++17/		    Replacement for untyped storage (`void*')		      
		   `<optional>'		   /C++17/		    "Maybe" monad					      
		   `<variant>'		   /C++17/		    Replacement for C-style discriminated unions	      
		   `<compare>'		   /C++20/									      
		   `<version>'		   /C++20/									      
		   `<new>'												      
		   `<memory>'												      
		   `<scoped_allocator>'	   /C++11/		    Useful in writing allocator-aware containers..	      
		   `<memory_resource>'	   /C++17/		    Unsupported by mainstream implementations.		      
   `<limits.h>'	   `<climits>'					    Prefer the functionality in `<limits>'		      
   `<float.h>'	   `<cfloat>'					    Prefer the functionality in `<limits>'		      
   `<stdint.h>'	   `<cstdint>'		   /C++11/									      
   `<inttypes.h>'  `<cinttypes>'	   /C++11/									      
		   `<limits>'												      
		   `<exception>'											      
		   `<stdexcept>'											      
   `<assert.h>'	   `<cassert>'					    Keep an eye on /C++20/ `<contract>'			      
		   `<system_error>'	   /C++11/		    [https://wg21.link/p0824r1]				      
   `<errno.h>'	   `<cerrno>'												      
		   `<contract>'		   /C++20/									      
   `<ctype.h>'	   `<cctype>'												      
   `<wctype.h>'	   `<cwctype>'												      
   `<string.h>'	   `<cstring>'					    Prefer the functionality in `<string>'		      
   `<wchar.h>'	   `<cwchar>'					    Prefer the functionality in `<string>'		      
   `<uchar.h>'	   `<cuchar>'		   /C++11/		    consider third-party solution for Unicode, e.g., ICU      
		   `<string>'												      
		   `<string_view>'	   /C++17/									      
		   `<charconv>'		   /C++17/									      
		   `<array>'		   /C++11/		    Prefer `std::array' over built-in arrays		      
		   `<vector>'					    `std::vector' is the "default" container		      
		   `<deque>'												      
		   `<list>'					    Doubly-linked lists					      
		   `<forward_list>'	   /C++11/		    Singly-linked lists					      
		   `<set>'												      
		   `<map>'												      
		   `<unordered_set>'	   /C++11/		    Hash sets						      
		   `<unordered_map>'	   /C++11/		    Hash tables						      
		   `<stack>'												      
		   `<queue>'												      
		   `<span>'		   /C++20/									      
		   `<algorithm>'											      
		   `<execution>'	   /C++17/		    Spotty support: consider third-party solutions	      
		   `<iterator>'												      
   `<math.h>'	   `<cmath>'												      
		   `<complex>'												      
		   `<valarray>'												      
		   `<random>'		   /C++11/									      
		   `<numeric>'												      
		   `<ratio>'		   /C++11/									      
   `<fenv.h>'	   `<cfenv>'		   /C++11/		    Spotty support: read your implementation's documentation. 
		   `<bit>'		   /C++20/									      
		   `<iosfwd>'												      
		   `<ios>'												      
		   `<istream>'												      
		   `<ostream>'												      
		   `<iostream>'												      
		   `<fstream>'												      
		   `<sstream>'												      
		   `<syncstream>'	   /C++20/									      
		   `<strstream>'		    /C++98/	    Prefer the functionality in `<sstream>'		      
		   `<iomanip>'												      
		   `<streambuf>'											      
   `<stdio.h>'	   `<cstdio>'					    Prefer the functionality in `<iostream>'		      
		   `<locale>'												      
   `<locale.h>'	   `<clocale>'					    Prefer the functionality in `<locale>'		      
		   `<codecvt>'		   /C++11/  /C++17/	    Consider a third-party solution.			      
		   `<regex>'		   /C++11/									      
		   `<atomic>'		   /C++11/									      
		   `<thread>'		   /C++11/									      
		   `<mutex>'		   /C++11/									      
		   `<shared_mutex>'	   /C++14/									      
		   `<future>'		   /C++11/									      
		   `<condition_variable>'  /C++11/									      
		   `<filesystem>'	   /C++17/									         

Last edited on
Slightly off-topic, it's been twenty years since C++ was standardised. While knowing this kind of thing is better than not knowing, if you've got an actual need for it, something is going very wrong.
mbozzi, thank you a lot for sharing that. I think it’s a great work.
old/obsolete current/new
<strstrea.h> <stream>

If <strstrea.h> is same or similar to the now deprecated header <strstream> the replacement would be <sstream> rather than <stream>.
Thank you
Topic archived. No new replies allowed.