
www.Usenet.com
Group Index
Comp Thread Archive from Usenet.com
Re: What's wrong with this?
- __From__: Matthias Hofmann
- __Subject__: Re: What's wrong with this?
- __Date__: Thu, 04 Dec 2003 12:52:56 -0600
Gianni Mariani <[EMAIL PROTECTED]> schrieb in im Newsbeitrag:
[EMAIL PROTECTED]
> Joe Developer wrote:
[snip]
>
> As a test, try this:
>
> template <typename T> void foo( T v )
> {
> char * x = v;
> x[0] = '9';
> }
>
> int main()
> {
> foo( "Hello World" );
> }
>
This should result in
void foo( const char* v )
{
char * x = v; // Assign const char* to char* - error?
}
What does the standard say about this? I guess that this should cause an
error!
Greetz,
Matthias
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
- Re: What's wrong with this?, (continued)
- Re: What's wrong with this?,
Hendrik Belitz
- Re: What's wrong with this?,
Francis Glassborow
- Re: What's wrong with this?,
Sascha Schwarz
- Re: What's wrong with this?,
nee Spangenberg
- Re: What's wrong with this?,
Matthias Hofmann
- Re: What's wrong with this?,
Ben Hutchings
- Re: What's wrong with this?,
Gianni Mariani
- Re: What's wrong with this?,
Matthias Hofmann
- Re: What's wrong with this?,
Antoun Kanawati
- Re: What's wrong with this?,
Frank A. Uepping
- Re: What's wrong with this?,
Vitaly
- Re: What's wrong with this?,
Jeroen Haegebaert
- Re: What's wrong with this?,
John Carson
- Re: What's wrong with this?,
kanze
- Re: What's wrong with this?,
Andreas Scherer
- Re: What's wrong with this?,
Allan W