206 - 问,C++CX:类型系统:命名空间、基础类型

206 - 问,C++CX:类型系统:命名空间、基础类型

Namespace

All Windows Runtime types must be declared within a namespace; 

A .winmd file must have the same name that the root namespace has.

In a namespace, Windows Runtime types—unlike standard C++ types—have either private or public accessibility. 

206 - 问,C++CX:类型系统:命名空间、基础类型_第1张图片

Fundamental types

C++/CX supports the fundamental numeric types in its default namespace as uint16, uint32, uint64, int16, int32, int64, float32, float64, and char16. Boolean and String are also defined in the Platform namespace.

C++/CX also defines uint8, equivalent to unsigned char, which is not supported in the Windows Runtime and cannot be used in public APIs.

typedefs

These typedefs are defined in the default namespace, which never needs to be specified explicitly.

Not all C++ built-in types (long, for example) are supported in the Windows Runtime. 

are built into C++/CX. Object and String are reference types. The others are value types. All of these types are declared in the Platform namespace. 

206 - 问,C++CX:类型系统:命名空间、基础类型_第2张图片

参考资料

http://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh755822.aspx

http://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh969551.aspx

你可能感兴趣的:(206 - 问,C++CX:类型系统:命名空间、基础类型)