• Saves Valuable Time
  • Trusted Accuracy since 2004
  • 15-Day Money-Back Guarantee

C# Equivalent to C++ Type Discovery

C++ C#
bool b = dynamic_cast<Foo*>(f) != nullptr; bool b = f is Foo;

C++ 'typeid' is only equivalent to C# 'typeof' for template type parameters:

C++ C#
template<typename T>
void method()
    std::type_info t = typeid(T);
private void method<T>()
    Type t = typeof(T);

Use C++ to C# Converter to convert from C++ to C#.     

Additional resource: C++ and C# Equivalents

Copyright © 2004 – 2021 Tangible Software Solutions, Inc.