From 3229205089195020679 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f78e5,1ac4d0270ad32ac8 X-Google-Attributes: gidf78e5,public From: AllanW@my-dejanews.com Subject: Re: C++ Strings and NULL Date: 1998/09/26 Message-ID: <6uhb0s$3e3$1@nnrp1.dejanews.com>#1/1 X-Deja-AN: 395131828 X-NNTP-Posting-Host: 199.125.171.8 Approved: stephen.clamage@sun.com (comp.std.c++) References: <6u9217$cj9$1@mark.ucdavis.edu> X-Snookums: I love you X-Http-User-Agent: Mozilla/4.06 [en] (Win95; U) X-Http-Proxy: 1.0 x2.dejanews.com:80 (Squid/1.1.22) for client 199.125.171.8 Organization: Deja News - The Leader in Internet Discussion X-Article-Creation-Date: Sat Sep 26 00:03:41 1998 GMT Newsgroups: comp.std.c++ Originator: clamage@taumet In article <6u9217$cj9$1@mark.ucdavis.edu>, Karl Nelson wrote: > Why was is decided not to define a basic_string((char*)NULL) as > being equivalent to a basic_string();? > > Is there any reason why NULL behavior was left undefined by the standard? > > Sample code: > > #include > > int foo(const string &bar) > { return 1; > } // Add this simple inline adapter function // which calls foo(string) with a valid string inline int foo(const char*text) // Note: Works even if text is NULL { return foo(text ? string(text) : string()); } > main() > {char *test=NULL; > foo(test); > } -- AllanW@my-dejanews.com is a "Spam Magnet" -- never read. Please reply in USENET only, sorry. -----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum [ 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 ] [ --- Please see the FAQ before posting. --- ] [ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html ]