[cfe-dev] A question about templates and best viable functions

Richard Smith richard at metafoo.co.uk
Mon Sep 15 17:03:39 PDT 2014


On Mon, Sep 15, 2014 at 3:42 AM, Sebastian Redl <
sebastian.redl at getdesigned.at> wrote:

>
> On 15 Sep 2014, at 3:59, Richard Smith <richard at metafoo.co.uk> wrote:
>
>
> This gives a rather different problem. In the original question, we had
>
> MyStruct -> float* -> bool -> void func(bool)
> MyStruct -> T* (T = int) -> void func(int*)
>
> (Note that we can't use the template for the bool overload of func,
> because we cannot deduce T.) In your version, we have an ambiguous
> conversion sequence for MyStruct and a user-defined conversion sequence for
> func(int*).
>
>
> The struct is the template, not the conversion operator. And once the
> struct template is instantiated, there is no difference to a non-template
> struct.
>

Sorry, right you are =)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140915/8505ea6d/attachment.html>


More information about the cfe-dev mailing list