Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

For how long before standardisation was `string` available?

Tags:

c++

history

C++ was formally standardised in 1998, but how far back can we find a class named string that looks like std::string does in C++2003 in a pre-standard C++ implementation?

I ask because CString, as part of MFC, has been "out there" since 1992 and I'm trying to determine whether it was first seen before or after what eventually became std::string.

like image 442
Lightness Races in Orbit Avatar asked Jan 23 '13 18:01

Lightness Races in Orbit


2 Answers

Well before. In 1992 everybody was still rolling their own string classes. Remember that std::string was originally terrible, and then it became terrible and an STL-style container- but that was very late in the process, as the Committee delayed the first Standard for two years to fit in the STL and everything Stepanov needed. So std::string wasn't finalized until fairly late.

like image 183
Puppy Avatar answered Nov 16 '22 12:11

Puppy


You might find one somewhat similar before 1998, but in practice, it was several years after the standard before you could more or less count on one being there. And the earlier ones were at best "sort of" similar; I remember noting the absense of push_back in one of the committee drafts (the last one, I think), which was an obvious oversight, that wouldn't have occured if anyone had implemented a version with the function.

like image 36
James Kanze Avatar answered Nov 16 '22 14:11

James Kanze