Boost logo

Boost :

From: Allen Ding (alding_at_[hidden])
Date: 2008-02-13 19:30:42


I think your understanding is right and the problem is with VC8.
The following compiles on VC8, but if you remove the template definition for
whatever, it fails as expected.

namespace useful {}

namespace useless {

using namespace useful;

template<typename T> class whatever {};

}

namespace useful
{
    struct alice {};
}

int main(int argc, char* argv[])
{
    alice u;
    return 0;
}

On Feb 13, 2008 3:40 PM, Robert Ramey <ramey_at_[hidden]> wrote:

> OK gurus - I looked into this a little bit and now I have a question.
>
> The code causing the problem looks like:
>
> namespace boost_132 {
> using namespace boost;
> // bunch of old code using boost namespace here
> }
>
> This was added to provide enough information in order to de-serialize
> shared pointers saved under the older system. By wrapping this in the
> namespace boost_132, it was my intention that the directive
> "using namespace boost;" apply only to the code in that namespace.
>
> It seems that the complaint is that its applying to code outside the
> namespace
> boost_132.
>
> Is my understanding of the scope of using directives wrong, or is this
> a compiler error?
>
> Then the question arises as to how it should be addressed. I don't see
> how the workaround for the borland compiler applies here. What I wanted
> to avoid was going through the code line by line. This is just imported
> code
> which in only there to support de-serialization of older archives which
> use
> shared pointer so I didn't want to create maintainence issue. So one
> thing
> is that the code should be included conditionally with something like
> BOOST_SERIALIZATION_SUPPORT_132_SHARED pointers. Aside
> from that I'm willing to hear ideas on this.
>
> Robert Ramey
>
> "Johan Råde" <rade_at_[hidden]> wrote in message
> news:fov8qu$63e$1_at_ger.gmane.org...
> > Sean Huang wrote:
> >
> >> This is very similar (or the same) to
> >> http://svn.boost.org/trac/boost/ticket/1285. Unfortunately, Robert did
> >> not
> >> want to take the fix proposed.
> >>
> >> Regards,
> >>
> >> Sean
> >
> > It is exactly the same problem.
> >
> > --Johan
> >
> > _______________________________________________
> > Unsubscribe & other changes:
> > http://lists.boost.org/mailman/listinfo.cgi/boost
> >
>
>
>
>
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost
>


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