Loading ...
Sorry, an error occurred while loading the content.
 

RE: [boost] boost bind/functional/reference wrapper/mem_fn

Expand Messages
  • Jason Shirk
    The anonymous namespace issue has been known for years, but not fixed yet, presumably because static works just as well (at least w/ VC.) We do not make any
    Message 1 of 32 , Feb 1, 2002
      The anonymous namespace issue has been known for years, but not fixed
      yet, presumably because static works just as well (at least w/ VC.)

      We do not make any restrictions on what you can use in a PCH. Anything
      that doesn't work (like anonymous namespaces) is definitely a bug.

      I'll look into fixing this for VC7.1.

      BTW, has anyone tried this with Comeau's PCH support?

      Jason Shirk
      VC++ Compiler Team

      > -----Original Message-----
      > From: Fernando Cacciola [mailto:fcacciola@...]
      > Sent: Thursday, January 31, 2002 6:44 AM
      > To: boost@yahoogroups.com
      > Subject: RE: [boost] boost bind/functional/reference wrapper/mem_fn
      >
      >
      > ----- Original Message -----
      > From: Yitzhak Sapir <ysapir@...>
      > To: <boost@yahoogroups.com>
      > Sent: Thursday, January 31, 2002 11:35 AM
      > Subject: RE: [boost] boost bind/functional/reference wrapper/mem_fn
      >
      >
      > > header:
      > > namespace { struct a { int x; }; static a z; }
      > > int sum1(int x, int y);
      > > int sum2(int x, int y);
      > >
      > > file 1:
      > > #include "stdafx.h"
      > >
      > > int sum2(int x, int y)
      > > {
      > > return x + y + z.x;
      > > }
      > >
      > > file 2:
      > > #include "stdafx.h"
      > >
      > > int sum1(int x, int y)
      > > {
      > > return x + y + z.x;
      > > }
      > >
      > > int main(int argc, char* argv[])
      > > {
      > > z.x = 4;
      > > int b1 = sum1(2 ,3);
      > > z.x = 5;
      > > int b2 = sum2(4, 3);
      > > return 0;
      > > }
      > >
      > > compiles fine with precomp headers, but doesn't with precomp headers
      and
      > > without the static.
      > >
      > Interesting! MSVC deserves some credit for this!
      > 'z' requires storage and it usually prevents generation of precompile
      > headers.
      >
      > BTW, does it work just the same with 'const' instead of 'static'?
      >
      > Fernando Cacciola
    • Jason Shirk
      The anonymous namespace issue has been known for years, but not fixed yet, presumably because static works just as well (at least w/ VC.) We do not make any
      Message 32 of 32 , Feb 1, 2002
        The anonymous namespace issue has been known for years, but not fixed
        yet, presumably because static works just as well (at least w/ VC.)

        We do not make any restrictions on what you can use in a PCH. Anything
        that doesn't work (like anonymous namespaces) is definitely a bug.

        I'll look into fixing this for VC7.1.

        BTW, has anyone tried this with Comeau's PCH support?

        Jason Shirk
        VC++ Compiler Team

        > -----Original Message-----
        > From: Fernando Cacciola [mailto:fcacciola@...]
        > Sent: Thursday, January 31, 2002 6:44 AM
        > To: boost@yahoogroups.com
        > Subject: RE: [boost] boost bind/functional/reference wrapper/mem_fn
        >
        >
        > ----- Original Message -----
        > From: Yitzhak Sapir <ysapir@...>
        > To: <boost@yahoogroups.com>
        > Sent: Thursday, January 31, 2002 11:35 AM
        > Subject: RE: [boost] boost bind/functional/reference wrapper/mem_fn
        >
        >
        > > header:
        > > namespace { struct a { int x; }; static a z; }
        > > int sum1(int x, int y);
        > > int sum2(int x, int y);
        > >
        > > file 1:
        > > #include "stdafx.h"
        > >
        > > int sum2(int x, int y)
        > > {
        > > return x + y + z.x;
        > > }
        > >
        > > file 2:
        > > #include "stdafx.h"
        > >
        > > int sum1(int x, int y)
        > > {
        > > return x + y + z.x;
        > > }
        > >
        > > int main(int argc, char* argv[])
        > > {
        > > z.x = 4;
        > > int b1 = sum1(2 ,3);
        > > z.x = 5;
        > > int b2 = sum2(4, 3);
        > > return 0;
        > > }
        > >
        > > compiles fine with precomp headers, but doesn't with precomp headers
        and
        > > without the static.
        > >
        > Interesting! MSVC deserves some credit for this!
        > 'z' requires storage and it usually prevents generation of precompile
        > headers.
        >
        > BTW, does it work just the same with 'const' instead of 'static'?
        >
        > Fernando Cacciola
      Your message has been successfully submitted and would be delivered to recipients shortly.