This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [GSoC] __enable_shared_from_this_helper
- From: Fan You <youfan dot noey at gmail dot com>
- To: Tim Shen <timshen at google dot com>
- Cc: Jonathan Wakely <jwakely at redhat dot com>, Tim Shen <timshen91 at gmail dot com>, "libstdc++" <libstdc++ at gcc dot gnu dot org>
- Date: Sun, 3 May 2015 22:39:22 -0400
- Subject: Re: [GSoC] __enable_shared_from_this_helper
- Authentication-results: sourceware.org; auth=none
- References: <CALvpekGVZEMtGN5MKVXrArG5cKJhqDQjsfgjdFZYk0=H=7+V_Q at mail dot gmail dot com> <20150428215024 dot GF3618 at redhat dot com> <20150428215349 dot GG3618 at redhat dot com> <CALvpekGhEJfEWdHmtOyco-Ua=sPjk4yhpFFE7Fzffy9cTmnVbA at mail dot gmail dot com> <CAG4ZjN=a9nvQ3CgqRiSze-fbUvh0u69WQQdehS5+mFXsvtSP=A at mail dot gmail dot com> <20150429100344 dot GH3618 at redhat dot com> <CAG4ZjNnFTOtEoSPdzv9Dip8s7O6o4ToL2+N-j_oEuxvrD1spLA at mail dot gmail dot com> <20150430112352 dot GR3618 at redhat dot com> <CAG4ZjNmgtF-7jE17d=e8fK_iMhkDHT783Qv1sYpt6MPKsmLL=A at mail dot gmail dot com> <20150430174827 dot GU3618 at redhat dot com> <CALvpekGSvSvg=WcF4w2r3LQ377azPfsAKfLtA5pFm3OKz6DesA at mail dot gmail dot com> <CAG4ZjNmAeB_CvR_4HXO7y3=FxcsTfAXi95RxeH=c8ngfTic5vA at mail dot gmail dot com> <CALvpekF+Y1C+EgevdyEzgt++OEUz4iyjCdTnA6Ny5Ak=b88HTg at mail dot gmail dot com> <CAG4ZjNktcN84WzhTMx-N7SDCG6DYdcH-P6FwnExd-gjp-RH3RQ at mail dot gmail dot com> <CALvpekEmg5f38iXpkNuaXmU0TNJboJSUAEEMo9Qpe4GrFhaTUw at mail dot gmail dot com> <CAG4ZjNmhovdYMH+jXxFqjaJEHFxed1rg3BtCyecGxX-xsMuWLQ at mail dot gmail dot com> <CAG4ZjN=3PUydKEUp8AWn7zVws=eVe9VvvpgnAkkUc257PfLhBg at mail dot gmail dot com> <CAG4ZjN=epzVM8VwCNiy1qJo3TZfEj8j=8PPH0VW6nROxk_wbXw at mail dot gmail dot com>
got it!
Thanks
2015-05-03 22:22 GMT-04:00 Tim Shen <timshen@google.com>:
> On Sun, May 3, 2015 at 7:17 PM, Tim Shen <timshen@google.com> wrote:
>> Notice that the real function body of the matched function is defined
>> in std::enable_shared_from_this in shared_ptr.h.
>
> The reason is __p, whose type is A*, is implicitly converted to
> std::enable_shared_from_this<A>*, since the latter is a public base
> class of the former.
>
> I don't know how exactly variadic parameter list are resolved, but
> based on the result, the second version (who takes an implicit
> converted base pointer) won the resolution.
>
> You may read the standard to know more about overloading resolution,
> but I don't think that's necessary.
>
>
> --
> Regards,
> Tim Shen