$include_dir="/home/hyper-archives/boost/include"; include("$include_dir/msg-header.inc") ?>
From: Beman Dawes (bdawes_at_[hidden])
Date: 2001-07-20 13:01:13
At 01:33 PM 7/20/2001, Greg Colvin wrote:
>I notice that http://users.utu.fi/sisasa/oasis/cppfaq/ctors.html#[10.10]
>recommends the following idiom:
>
> Fred& x()
> {
> static Fred* ans = new Fred();
> return *ans;
> }
>
>when I would have expected
>
> Fred& x()
> {
> static Fred ans;
> return ans;
> }
>
>or am I missing something (as usual)?
Ask Jerry Schwarz. Isn't he the world's leading expert on static
initialization tricks:-?
--Beman