私がこのc++cliコードを持っているとき:
#pragma managed
ref class mcSessions: ConcurrentDictionary <String ^, mcSession^>
{ //<---- warning here
private:
static mcSessions ^g_Sessions;
TimeSpan MaxIdleTime;
mcSessions (TimeSpan newMaxIdleTime);
public:
static void Initialize (long MaxIdleMinutes);
static void Shutdown ();
static void CreateSession (String ^&SessionId);
static void RunInSession (String ^SessionId, String ^Command);
static void RemoveSession (String ^SessionId);
};
最初の{で警告C4538が表示されます。誰かがこれが起こる理由とそれが警告するものの手がかりを持っていますか、またはこれはこの質問の状況のようにコンパイラのバグでもあります:C ++/CLIでの不適切なコンパイル警告のようです
それらは多少関連しているように見えますが、私はGroup
オブジェクトではなく、を持っていますConcurrentDictionary
。.NET4.0フレームワークを対象としたVisualStudio2010を使用しており、/clrコンパイラフラグをオンにしてコンパイルしています。
正確なエラーメッセージは次のとおりです。
1>d:\t4edevnet2010\umra2\iampowershell\mcIpSessions.h(25): warning C4538: 'cli::array<Type,dimension> ^' : const/volatile qualifiers on this type are not supported
1> with
1> [
1> Type=System::Collections::Concurrent::ConcurrentDictionary::Node ^,
1> dimension=1
1> ]
1> This diagnostic occurred while importing type 'System::Collections::Concurrent::ConcurrentDictionary ' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
1>d:\t4edevnet2010\umra2\iampowershell\mcIpSessions.h(25): warning C4538: 'cli::array<Type,dimension> ^' : const/volatile qualifiers on this type are not supported
1> with
1> [
1> Type=int,
1> dimension=1
1> ]
1> This diagnostic occurred while importing type 'System::Collections::Concurrent::ConcurrentDictionary ' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
1>d:\t4edevnet2010\umra2\iampowershell\mcIpSessions.h(25): warning C4538: 'cli::array<Type,dimension> ^' : const/volatile qualifiers on this type are not supported
1> with
1> [
1> Type=System::Collections::Concurrent::ConcurrentDictionary<TKey,TValue>::Node ^,
1> dimension=1
1> ]
1> d:\t4edevnet2010\umra2\iampowershell\mcIpSessions.h(25) : see reference to class generic instantiation 'System::Collections::Concurrent::ConcurrentDictionary<TKey,TValue>' being compiled
1> d:\t4edevnet2010\umra2\iampowershell\mcIpSessions.h(25) : see reference to class generic instantiation 'System::Collections::Concurrent::ConcurrentDictionary<TKey,TValue>' being compiled
1> with
1> [
1> TKey=System::String ^,
1> TValue=IamPowershell::mcSession ^
1> ]
1> This diagnostic occurred while importing type 'System::Collections::Concurrent::ConcurrentDictionary::Node ' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
1>d:\t4edevnet2010\umra2\iampowershell\mcIpSessions.h(25): warning C4538: 'cli::array<Type,dimension> ^' : const/volatile qualifiers on this type are not supported
1> with
1> [
1> Type=int,
1> dimension=1
1> ]
1> This diagnostic occurred while importing type 'System::Collections::Concurrent::ConcurrentDictionary::Node ' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
1>d:\t4edevnet2010\umra2\iampowershell\mcIpSessions.h(25): warning C4538: 'cli::array<Type,dimension> ^' : const/volatile qualifiers on this type are not supported
1> with
1> [
1> Type=System::Collections::Concurrent::ConcurrentDictionary<System::String ^,mcSession ^>::Node ^,
1> dimension=1
1> ]
1>d:\t4edevnet2010\umra2\iampowershell\mcIpSessions.h(25): warning C4538: 'cli::array<Type,dimension> ^' : const/volatile qualifiers on this type are not supported
1> with
1> [
1> Type=int,
1> dimension=1
1> ]
1>