C++11 style SFINAE and function visibility on template instantiation

前端 未结 1 1746
[愿得一人]
[愿得一人] 2020-12-21 14:56

I\'m not sure if this has anything to do with sfinae, or just something thats relevant for any templated function. I am attempting to use sfinae to enable/disable a member f

相关标签:
1条回答
  • 2020-12-21 15:53

    This has nothing to do with SFINAE or templates or C++11 or ADL.

    A member shadows all non-members with the same name, regardless of type. If you have a member named f, you cannot refer to any non-member named f, unless you use a qualified name (e.g. ::f).

    Just use ::f(*this, t);.

    0 讨论(0)
提交回复
热议问题