|
-
June 18th, 2012, 02:00 PM
#5
Re: reference semantic for pimpl class
 Originally Posted by superbonzo
BTW, probably it was just for brevity, but the code snippet is wrong because you're new-ing an incomplete type ( this is an error ) and you're deleting an incomplete type ( this is UB, in general ).
Yeah, you caught that. It was for brevity. The code is actually in a cpp.
 Originally Posted by superbonzo
as far as the reference is concerned, the only problem I see is in the event of "new" returning 0; anyway, nothing really serious ... 
 Originally Posted by laserlight
Doesn't sound like a problem though since nothrow new was not used.
Yup.
Thanks for your feedbacks.
Is your question related to IO?
Read this C++ FAQ article at parashift by Marshall Cline. In particular points 1-6.
It will explain how to correctly deal with IO, how to validate input, and why you shouldn't count on "while(!in.eof())". And it always makes for excellent reading.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|