Boost logo

Boost :

From: Fernando Cacciola (fcacciola_at_[hidden])
Date: 2002-01-31 09:25:41


----- Original Message -----
From: Yitzhak Sapir <ysapir_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Thursday, January 31, 2002 11:22 AM
Subject: RE: [boost] boost bind/functional/reference wrapper/mem_fn

> My experiment had a header which declared an int variable in an unnamed
> namespace. Then it had two source files which use this variable in
> functions (which sum this variable with their parameters), and the
> main() in one source file called both functions. This produced a
> problem when compiled with precompiled headers. When I changed the int
> to static int (still in an unnamed namespace), it didn't have problems.
> When run it seems to keep a different copy of the int for each source
> file.
>
I see.
Now try declaring a static object of class type, not of built-in type:

struct A {} ;
static /*or const*/ A a ;

Alternatively, try with 'double' instead of 'int'.

I think that this won't precompile.

Fernando Cacciola
Sierra s.r.l.
fcacciola_at_[hidden]
www.gosierra.com


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