|
Boost : |
From: David B. Held (dheld_at_[hidden])
Date: 2004-07-08 14:24:58
Larry Evans wrote:
> [...]
> I very much sympathize with you; however, I have no answers :(
> I went through the same confusion with my managed_ptr's nested
> ownership template class. It was discussed here:
>
> http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&selm=1044dnuf7ojhpc0%40corp.supernews.com
> [...]
It looks like Gabriel gives the best answer in that thread. My
understanding is now that non-deduced contexts occur partly because
specializations may be defined after instantiations of a given
template class. And this is why simply adding another operator
won't work. One way to eliminate non-deducibility would be to
require that all specializations be defined before any template
of that type is instantiated. However, this would make certain
types of code impossible. Another solution would be say that
argument deduction proceeds with only the specializations visible
at the point of instantiation. However, that would probably be
confusing. Another solution would be to have instantiation occur
in a separate pass, after all possible specializations have been
seen. Then it seems that it should be possible to deduce many
contexts that are only non-deducible because of possible
specializations. But people are likely to say that that is too
expensive for the benefit gained.
Dave
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk