How to typeof in C++

前端 未结 8 1572
再見小時候
再見小時候 2020-12-10 18:30

How to simulate C# typeof-command behavior in C++?

C# example:

public static PluginNodeList GetPlugins (Type type)
{
 ...
}

Call:

8条回答
  •  醉话见心
    2020-12-10 19:04

    Boost does have a typeof. C++ 0x doesn't call it typeof, but has both 'auto' and 'decltype' that provide the same kinds of functionality.

    That said, I'm pretty sure none of those provides what you're really looking for in this case -- at most, they provide only a small piece of what you need/want overall.

提交回复
热议问题