How do I do C# typeof(bool) in C++/CLI?

c#, c++-cli, types

Solution

The exact equivalent of C#'s typeof operator is provided in C++/CLI by the `typeid` operator:

Type^ t = bool::typeid;

Problem

I'm trying to find out if VisualHint.SmartPropertyGrid.PropertyGrid will meet my needs for setting properties, and some of my properties are boolean values. One of the parameters is ``` // container: // The instance of an object containing the C# property displayed in this new // property. ``` So in general, I can just hand it a suitable object - but, booleans are value types, not objects. In C#, the right syntax is to enter the container as `typeof(bool)`. Is there any sensible way to do this in C++, or do I have to make my own bool object?

Original source

Related problems