[RFC] std::string(0);

Daniel Frey daniel.frey@aixigo.de
Tue Jun 15 07:59:00 GMT 2004


Loren James Rittle wrote:
> In article <1087279330.1403.0.camel@localhost.localdomain>,
> Dhruv Matani<dhruvbird@gmx.net> writes:
> 
> 
>>>>BTW, would "" be equivalent to '\0'?
> 
> 
> "" is a pointer.  '\0' is a character.

"" is an array of const char, not a pointer. The difference can be seen 
here:

template< int N >
void f( const char(&)[N] ) {}

int main() {
   const char* p = "";
   f( "" );
   f( p );
}

Regards, Daniel

-- 
Daniel Frey

aixigo AG - financial solutions & technology
Schloß-Rahe-Straße 15, 52072 Aachen, Germany
fon: +49 (0)241 936737-42, fax: +49 (0)241 936737-99
eMail: daniel.frey@aixigo.de, web: http://www.aixigo.de




More information about the Libstdc++ mailing list