From: Aleksey Gurtovoy (agurtovoy_at_[hidden])
Date: 2002-11-13 04:08:11
Douglas Gregor wrote:
> Once we've solved the "technically", I think the politically best
> way to handle this would be to submit a very detailed defect report.
> The problem is easy to point out, and it is easy to give a case
> where the standard is ambiguous. However, we must give the committee
> the "big picture" regarding their decision: resolving the defect
> "our way" will make C++ a vastly more powerful and more safe
> language, because we will have the power to do concept-checking
> without spewing mountains of errors when we find a failure.
> And someone better be at the meeting when the committee discusses
> this :)
Sounds like a plan that might actually work :).
> [snip code]
> > template< typename Functor, typename R, typename T1 >
> > yes_tag is_callable_helper(
> > sink< sizeof(static_cast<R>(
> > get<Functor>().Functor::operator()( get<T1>()
> ) // here
> > ))>
> > );
> [snip more code]
> > The marked line falls directly under one of the 14.8.2 para
> > 2's items:
> > "-- Attempting to use a type in the qualifier portion of a
> > qualified name that names a type when that type does not
> > contain the specified member [...]"
> Right, but if there is an operator() but no operator() that
> takes a single parameter of a type convertible from T1, or if
> the return type can't be static_cast to R, we're back to a case
> that isn't listed in 14.8.2 paragraph 2.
You are right, of course, at least partially :). The return type conversion
would fall under this one:
"-- Attempting to perform an invalid conversion in either a template
argument expression, or an expression
used in the function declaration."
But "no match" situation indeed throws us back to where we were with the
previous attempt. Well, more motivation to pursue the plan :).
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk