From -3172160790527692997
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,7eeaa4cabd8e56fe
X-Google-Attributes: gidf78e5,public
From: Edward Diener <eddielee@abraxis.com>
Subject: Re: std::basic_string::operator const charT*()
Date: 1997/09/26
Message-ID: <342B2446.DCE6B1AD@abraxis.com>#1/1
X-Deja-AN: 275843826
References: <3427C76E.7FEE@chemie.uni-halle.de>
X-Original-Date: Thu, 25 Sep 1997 22:56:06 -0400
Organization: -
X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBVAwUBNCw48Uy4NqrwXLNJAQHsWgH8Dpoln+OMyth784jbNR21dCkvx0ZHIyt0 IAZNag29HBj0v9IU/g12VXNzlvZqZTldjEGtkHRZSXRWFIWVCuC68A== =S5pB
Reply-To: eddielee@abraxis.com
Newsgroups: comp.std.c++
Originator: austern@isolde.mti.sgi.com


There is a c_str() member function that returns the const char * . I believe the
explanation for not having a const char * casting operator is that since there is
a const char * constructor the compiler would not know what to do when mixing the
std:basic_string class with character constants in an expression since if you
could convert both ways there would be ambiguity as far as which eay to convert
and this would lead to a compiler error.

Ryszard Kabatek wrote:

> Hi,
> There is no const charT* casting operator defined for the
> std::basic_string class
> in the Draft.
> Why?
>
> --
> Ryszard Kabatek
> ---
> [ comp.std.c++ is moderated.  To submit articles: try just posting with      ]
> [ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu         ]
> [ FAQ:      http://reality.sgi.com/employees/austern_mti/std-c++/faq.html    ]
> [ Policy:   http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
> [ Comments? mailto:std-c++-request@ncar.ucar.edu                             ]
---
[ comp.std.c++ is moderated.  To submit articles: Try just posting with your 
                newsreader.  If that fails, use mailto:std-c++@ncar.ucar.edu
  comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
  Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
  Comments? mailto:std-c++-request@ncar.ucar.edu 
]



