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

C++ Equivalent to VB 'Object'

In C++17, the std::any type offers a good equivalent to System.Object.

VB C++ (C++17)
Dim o As Object = 1
Dim i As Integer = DirectCast(o, Integer)
Dim t As Type = o.GetType()
#include <any>
#include <typeinfo>

std::any o = 1;
int i = std::any_cast<int>(o);
std::type_info t = o.type();

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

Additional resource: VB.NET and C++ Equivalents

Copyright © 2004 – 2021 Tangible Software Solutions, Inc.