From: "Ruslan Abdikeev" Newsgroups: comp.lang.c++,comp.os.msdos.djgpp,gnu.g++.help Subject: Re: Problem with basic_string Date: Sat, 4 Jan 2003 17:25:38 +0300 Organization: VoronezhSvyazInform ISP News Server Lines: 56 Message-ID: References: NNTP-Posting-Host: 62.16.120.98 X-Trace: serv3.vsi.ru 1041690339 54209 62.16.120.98 (4 Jan 2003 14:25:39 GMT) X-Complaints-To: postmaster AT vsi DOT ru NNTP-Posting-Date: Sat, 4 Jan 2003 14:25:39 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com "Alex Vinokur" wrote in message news:av6p7v$ciff4$1 AT ID-79865 DOT news DOT dfncis DOT de... > "Ruslan Abdikeev" wrote in message news:av6n2q$1ct4$1 AT serv3 DOT vsi DOT ru... > > "Alex Vinokur" wrote in message news:av6mgq$cjiq1$1 AT ID-79865 DOT news DOT dfncis DOT de... > [snip] > > > > > > int main () > > > { > > > basic_string bs1; > > > > I'm sure you were intended basic_string bs1; > > I intended exactly basic_string bs1; > > basic_string is a template class. > So, I would like to basic_string, basic_string, basic_string > Hence, my reasoning: > > > > You cannot use basic_string, because > > std::string is NOT a char-like type (which shall be POD). > > > > > bs1 += "ABC"; > > It is just impossible, because conforming specialisation of basic_string cannot be a POD. "This clause describes components for manipulating sequences of "characters", where characters may be of any POD (3.9) type." (21/1) "The header defines a basic_string class template and its traits that can handle all char-like (clause 21) template arguments with several function signatures for manipulating varying-length sequences of char-like objects." (21.2/1) "For a char-like type charT, the template class basic_string [...]" (21.3/1) basic_string shall contain constructors, copy constructor, destructor and assignment operators (21.3/6). "A POD-struct is an aggregate class that [...] has no user-defined copy assignment operator and no user-defined destructor." (9/4) "An aggregate is an array or a class (clause 9) with no user-defined constructors (12.1), no private or protected non-static members (clause 11), no base classes (clause 10), and no virtual functions (10.3)." (8.5.1/1) HTH, Ruslan Abdikeev Brainbench MVP for Visual C++ http://www.brainbench.com