Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Why doesn't this work? (pointers)

Reply
Thread Tools

Why doesn't this work? (pointers)

 
 
Ron Natalie
Guest
Posts: n/a
 
      10-12-2004
Mike Wahler wrote:

> The difference between our assertions is that you qualified
> with 'POD' (and I used 'automatic' instead of 'default').


Yes, without the qualification of POD types, your statement
is wrong. The defect in the language is that automatic POD
types are not default initalized when other non-POD types
would be.

>
>
> I think you're confusing me. What about such an object
> initialized via an argument? (OR do you mean only those
> declarations lacking an initializer?)


Default initialization, i.e., those without explicit initializers.
 
Reply With Quote
 
 
 
 
Ron Natalie
Guest
Posts: n/a
 
      10-12-2004

> I was actually asking a genuine question, although I was pretty sure of
> the answer. I get burned every now and then with "things in C++ what is
> different than C". I didn't think there was a prohibition, and as I
> recall some compilers do that in debug mode.


Right, there is no prohibition. The compiler is just not required
to initialize POD types in certain circumstances.

This whole initialization debacle, and the bandaids the standards
committee put on it with value initailziation is just odiferous slavish
following of the way things were always done in C. It causes more
problems than it solves, and if it were changed today, it would break
no code (although some people who rely on not using RAII might get a
little slower). If you want to skip default initialization, I think
that should be the explicit case.
 
Reply With Quote
 
 
 
 
Ioannis Vranos
Guest
Posts: n/a
 
      10-12-2004
Ron Natalie wrote:

> Yes, without the qualification of POD types, your statement
> is wrong. The defect in the language is that automatic POD
> types are not default initalized when other non-POD types
> would be.


Actually it is not a defect.


Check this message:

http://groups.google.com/groups?hl=e...rldnet.att.net



--
Ioannis Vranos

http://www23.brinkster.com/noicys
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
why why why why why Mr. SweatyFinger ASP .Net 4 12-21-2006 01:15 PM
findcontrol("PlaceHolderPrice") why why why why why why why why why why why Mr. SweatyFinger ASP .Net 2 12-02-2006 03:46 PM
Cisco 2611 and Cisco 1721 : Why , why , why ????? sam@nospam.org Cisco 10 05-01-2005 08:49 AM
Why, why, why??? =?Utf-8?B?VGltOjouLg==?= ASP .Net 6 01-27-2005 03:35 PM
Why Why Why You HAVE NO IDEA MCSE 31 04-24-2004 06:40 PM



Advertisments