string class not standard

S

Samuel Krempp

(e-mail address removed) (03 May 2005 17:33,
I have set mine to a default of utf-8.

right, that's going to be more and more of a common default.
But aren't there still a few forums with policies against posting in UTF-8 ?

Also that explains why the 'é' was invisible for you : within ASCII text, it
makes the sequence of bytes invalid for UTF-8, so it caused an error when
reading the message, and the erroneus byte was ignored.
 
M

msalters

(e-mail address removed) schreef:
Standard C++ has no string class.

It has two.
See ISO 14882, section 21.2 String classes [lib.string.classes]

HTH,
Michiel Salters
 
A

Abecedarian

msalters said:
(e-mail address removed) schreef:
Standard C++ has no string class.

It has two.
See ISO 14882, section 21.2 String classes [lib.string.classes]

FYI, I was persuaded that there is almost no difference between a class
template instantiation and a 'real' class (i.e. a class without
template parameters) and that both constitute a class in C++.

::A::
 
R

Rolf Magnus

Abecedarian said:
template, the latter an instance of it, i.e. a class.

class template, class template instantiation, class: 3 different
concepts in C++.

I fail to see how a class template instantiation is not a class.
 
D

djake

Maybe the information in my question was incomplete, so i want
include the entire header file I found in unixware systems. It doesn't
seem standard to me. And this doesn't permit to declar a string in this
way:

string varStr;

Infact the previous line generate error using my CC compiler.

Below the integral content of /usr/include/CC/string:



#ident "@(#)unixsrc:usr/src/common/lib/libC/string /main/uw7_nj/1"

// this is a dummy version of the new standard library <string> class,
// intended only to allow some of the new exception classes to work

#ifdef __cplusplus

#ifndef _STRING_CXX
#define _STRING_CXX

class string {
public:
string(const char* c) { s = c; }
const char* c_str() const { return s; }
private:
const char* s;
};

#endif

#endif
 
R

Rolf Magnus

Maybe the information in my question was incomplete, so i want
include the entire header file I found in unixware systems. It doesn't
seem standard to me.

It isn't.
And this doesn't permit to declar a string in this way:

string varStr;
Right.

// this is a dummy version of the new standard library <string> class,
// intended only to allow some of the new exception classes to work

Well, doesn't that comment give you a hint?
 
F

friedlinguini

I fail to see how a class template instantiation is not a class.

See how far this gets you:

namespace std {
class string;
}

#include <string>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,202
Messages
2,571,057
Members
47,667
Latest member
DaniloB294

Latest Threads

Top