|
Boost : |
Subject: Re: [boost] [Polygon] Unqualified name lookup of 'gtlsort' in templates
From: Simonson, Lucanus J (lucanus.j.simonson_at_[hidden])
Date: 2011-03-07 13:27:41
Doug Gregor wrote:
> The Polygon library has a minor C++ standards-conformance issue w.r.t.
> unqualified name lookup in templates for 'gtlsort' operator. In
> particular, the header <boost/polygon/polygon.hpp> includes a number
> of source files that make unqualified calls to 'gtlsort'. 'gtlsort'
> itself is not defined until much later, when
> <boost/polygon/detail/scan_arbitrary.hpp> pulls in
> <boost/detail/polygon_sort_adaptor.hpp>. At least in the cases used in
> the Boost.Polygon test, 'gtlsort' isn't found by ADL at instantiation
> time, either.
>
> Clang detects this conformance problem, which is described here:
>
> http://clang.llvm.org/compatibility.html#dep_lookup
>
> The solution is to provide forward declarations of the two 'gtlsort'
> overloads in a header that all users of 'gtlsort' depend on. For
> example, introducing a forward header containing
>
> namespace boost { namespace polygon {
> template <typename iter_type>
> void gtlsort(iter_type _b_, iter_type _e_);
>
> template <typename iter_type, typename pred_type>
> void gtlsort(iter_type _b_, iter_type _e_, const pred_type& _pred_);
> } }
>
> and including it before the users of 'gtlsort' would work fine.
Doug,
Thank you for this issue report. The intention of gtlsort is to provide a point of customization for overriding std sort at compile time with the parallel sort of the user's choosing. We should probably change the name to something more appropriate at the same time that we fix the conformance problem. The name glsort doesn't conform to the naming convention and refers to the former name of the library, which is a bad thing for an interface.
Thanks again,
Luke
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk