Boost logo

Boost :

From: William Kempf (sirwillard_at_[hidden])
Date: 2000-10-26 14:02:25


--- In boost_at_[hidden], Jeremy Siek <jsiek_at_l...> wrote:
> Each template parameter must appear in a deduced context at least
> once in the argument list of a template function, and type
expressions
> including :: are typically nondeduced contexts. So the test()
> function below is illegal.
>
> 14.8.2.4
> If a template parameter is used only in nondeduced contexts and
is not
> explicitly specified, template argument deduction fails.

Ok, live and learn. I'd say the error produced was ambiguous,
however, though that's forgivable. Some weird trivia, however:

Remove the call_traits stuff only from the second parameter and it
compiles fine. Similarly remove the second parameter all together
and it compiles. Remove the call_traits stuff only from the first
parameter and the compiler still complains about an ambiguity.

Guess because I violated the standard I found some strange corner
behavior on the compiler ;).

I guess I'm now a tad confused about the utility of call_traits. I
can see how it would help with template classes in some cases, but is
there another way to do what was being attempted here with a template
function?

What about the other problem I had? Did I make another obscure
error, or was the compiler at fault?

I've done a lot of reading about templates, including advanced
techniques, so I thought I knew what I was doing here. Guess the
fact that I've never used advanced features because of the compiler
I'm stuck with led me to at least one erroneous conclusion :).

Bill Kempf


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