|
-
June 21st, 2011, 09:10 AM
#1
static const & literal
Hi...I have a question concerning const/literal-functions and members
c++:
struct StyleConstants
{
static const CString TestConst="UniqueStringWhichShouldBeOnlyWrittenOnceInTheCode";
}
cli:
public ref class StyleConstNet
{
literal String^ TestConst=StyleConstants::TestConst;
}
but the code retrifes an Error:
error C3887: 'StyleConstNet::TestConst: the initializer for a literal data member must be a constant expression
The main problem is: I have to use StyleConstNet.TestConst like this:
case StyleConstNet.TestConst:
inside an switch-statement.
Is there any solution to this without ?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|