Boost logo

Boost :

From: Dean Michael Berris (mikhailberis_at_[hidden])
Date: 2006-07-10 04:56:15


On 7/8/06, Emil Dotchevski <emildotchevski_at_[hidden]> wrote:
> > exception_info * x = get_exception_info(e);
> > x++;
> > ++x;
>
> Let's assume get_exception_info returns a reference.
>
> How do you prevent this code:
>
> exception_info * x = &get_exception_info(e);
> x++;
> ++x;
>

You don't avoid it, but when you see this code, you're doing a whole
lot more to do something stupid -- that's why I'm really proposing and
would feel better returning references.

> Pointers are part of the C++ language, like it or not. :)
>

Yeah, as much as I'd like to get away from it, it's the sad reality. ;)

-- 
Dean Michael C. Berris
C/C++ Software Architect
Orange and Bronze Software Labs
http://3w-agility.blogspot.com/
http://cplusplus-soup.blogspot.com/
Mobile: +639287291459
Email: dean [at] orangeandbronze [dot] com

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk