|using (Foo f = new Foo())
Foo *f = new Foo();
or, if 'Foo' is designed for RAII:
Use C# to C++ Converter to convert from C# to C++.
C++ and C# Equivalents
Copyright © 1997 – 2018 Tangible Software Solutions Inc.