🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c++
Article #1729

Re: Why no conversion of string to const char * in STD lib?

#1729
From: Oren Ben-Kiki
Date: Wed, 16 Aug 1995 16:32
19 lines
1425 bytes
Distribution:
Rick Hollinbeck (rickh@csn.net) wrote:
: Don & (bashford@toad.scripps.edu) wrote:
: : According to Plauger's book on the Draft Standard C++ library,
: : there is no "operator const char *" for the string class.
: : [snip]

: From what I understand, the const char* conversion operator would trigger
: too many implicit type conversions in certain situations, leading to many
: unpleasant surprises. the c_str() member is a way to control this. (See
: Plauger's recent article in the C/C++ Users Journal which discusses this.)

But now that we have the 'explicit' keyword, shouldn't this decision be
reconsidered? This seems like just the situation for which it was intended.

---
[ comp.std.c++ is moderated.  Submission address: std-c++@ncar.ucar.edu.
  Contact address: std-c++-request@ncar.ucar.edu.  The moderation policy
  is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Technical Details
Message-ID: <MATT.95Aug16093212@physics2.Berkeley.EDU>
Path: arc1-ca.pugleaf.net!128.32.155.1!matt
References: <BASHFORD.95Aug1200815@toad.scripps.edu> <MATT.95Aug13161131@physics2.Berkeley.EDU>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!128.32.155.1!matt
From: oren@melissa.schema.co.il (Oren Ben-Kiki)
Newsgroups: comp.std.c++
Subject: Re: Why no conversion of string to const char * in STD lib?
Date: 16 Aug 1995 16:32:12 GMT
Organization: UTexas Mail-to-News Gateway
Approved: matt@physics2.Berkeley.EDU (Matt Austern)
Message-ID: <MATT.95Aug16093212@physics2.Berkeley.EDU>
References: <BASHFORD.95Aug1200815@toad.scripps.edu> <MATT.95Aug13161131@physics2.Berkeley.EDU>
NNTP-Posting-Host: physics2.berkeley.edu