How to explicitly/implicitly implemented interface members in C++/CLI?

佐手、 提交于 2020-01-04 09:08:02

问题


What's the equivalent in C++/CLI of this:

class Explicit : IClonable
{
    void IClonable.Clone()
    {
    }
}

class Implicit : IClonable
{
    public void Clone()
    {
    }
}

回答1:


As nobugz says, you can't explicitly implement IDisposable.

So, assuming that the title of your question is accurate, and you want to have explicit implementation of interface members (or explicit overrides which are supported in C++/CLI but I don't think are possible in C#, C++/CLI also provides more flexibility to override multiple v-table slots with the same function), see:

http://msdn.microsoft.com/en-us/library/fw0bbh51.aspx



来源:https://stackoverflow.com/questions/2421350/how-to-explicitly-implicitly-implemented-interface-members-in-c-cli

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!