Boost logo

Boost :

From: Hubert Holin (Hubert.Holin_at_[hidden])
Date: 2003-08-13 08:57:04


Somewhere in the E.U., le 13/08/2003

   Bonjour

      Sorry, I have been away from boost for the last month an a half or
so (an unbelievable string of deadlines *and* a vacation :-) ), with
some of the things I had done then not checked in.

      I'll try to fix the Gcc problem today (or tomorrow morning at the
latest), but I fear that some of the work I did for special functions,
some of which are required by quaternions and octonions, might create
some new, more delicate, problems with older compilers (in other words,
Gcc 2.95.x might be out).

      At any rate, I only have CodeWarrior locally available for tests
(but I will read the results of the various platform runs to fix
things), so it might prove inconvenient for the "imminent" release.

   A bientot

Hubert Holin

In article <1060747116.3f39b76c58378_at_[hidden]>,
 gmelquio_at_[hidden] wrote:

> En réponse à Beman Dawes <bdawes_at_[hidden]>:
>
> > Current GCC and Intel compilers don't appear to allow using declarations
> > at function scope, according to a bug report.
>
> What do you call "current"? As far as I know, only gcc 2.95 suffers from this
> bug (bug-report #1981 in gcc database), gcc 3.x and intel (on linux)
> correctly
> handle using declarations at function scope. I can tell because in the
> interval
> library, there is a workaround (using declaration at namespace scope) only
> activated with gcc 2.95.
>
> > Is there any reason not to just move the using declarations to namespace
> > scope?
> >
> > Answering my own queston, I think prefer the solution used in other
> > boost code where calls to say std::abs are explicitly qualified, and ifdef
> > BOOST NO STDC NAMESPACE then namespace std { using ::abs; } is
> > supplied.
> >
> > What are the pros and cons of the different approaches?
>
> If the purpose is to access a std:: function, I don't think there is much of
> a
> difference between the two approaches. I find the second one a bit more
> clean.
>
> However, if the user is allowed to provide its own type and its own function,
> the second approach doesn't work anymore. Here is what I mean:
>
> namespace my namespace {
> template <typename T> struct my type;
> template <typename T> my type<T> abs(my type<T>);
> }
> namespace boost {
> template <typename U> void a function(U u) {
> do something(std::abs(u));
> }
> }
> my namespace::my type<int> v;
> boost::a function(v);
>
> This code won't compile because the compiler can't find my namespace::abs in
> boost::a function. If the first approach (using declaration at namespace
> scope)
> had been used, it would have worked.
>
> Regards,
>
> Guillaume
>
> 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