|
Boost Users : |
Subject: Re: [Boost-users] [Fusion, maybe?] Workings of ADL.
From: Robert Jones (robertgbjones_at_[hidden])
Date: 2010-09-09 04:20:10
On Wed, Sep 8, 2010 at 5:57 PM, Steven Watanabe <watanabesj_at_[hidden]>wrote:
> AMDG
>
>
> 14.8.1/6:
> "... But when a function template with explicit template arguments
> is used, the call does not have the correct syntactic form unless
> there is a function template with that name visible at the point of
> the call...."
>
>
That is just the oddest rule! Going back to my original example, I could
make it work just by adding an arbritary declaration of at_c(),
#include <boost/fusion/include/vector.hpp>
#include <boost/fusion/include/at_c.hpp>
typedef boost::fusion::vector<int, int> V;
template <typename T, typename U> void at_c( const U & );
int first( const V & v )
{
return at_c<0>( v );
}
which doesn't even need to be defined anywhere. If such a namespace-enabling
template were to be removed, thus breaking the look-up used in my 'first()'
function
it would be a horrible bug to find!
- Rob.
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net