2. C++/CLI Constants (const or literal)
C++/CLI supports the const and static const keywords of standard C++ as well as the new literal keyword. A literal is equivalent to static const in standard C++ and Microsoft's documentation recommends to replace static const with the new literal keyword because a leteral is available in metadata; a static const variable is not available in metadata to other compilers.
You can use static const within the class declaration or locally within a method. However, literal is only valid in the class declaration section and const is only valid within a method.
12 years ago, and updated 12 years ago
(1 Comments
, last by Uwais.Q )
|