Visual C++ 2010 Expressを使用しています。I use Visual C++ 2010 Express.typedef char A[];typedef A &RA;上記は C2265: サイズが 0 の配列への参照は無効です というエラーが発生します。Above code raise an error, C2265: reference of zero sized array is invalid.extern char a[];typedef decltype((a)) RA2;上記は、エラーが発生せず char (&)[] という型を作ることができます。Above code can generate the type - char (&)[] without errors.char (&)[] という型は内部的には可能であることを示唆しています。It suggests the type - char (&)[] can be generated internally.https://connect.microsoft.com/VisualStudio/feedback/details/724314/t-const-char-t-const-cannot-receive-char上記のURLで char[] が T const & に変換できない問題を挙げましたが、現在では decltype を1つの回避策として使用しています。In above URL, I give the problem - T const & cannot receive char[], currently I am using decltype as an alternative method.しかし、この方法は、char [] 型の変数を宣言する必要があるため、任意の型 T に対する T const (&)[] を作れません。But this way cannot generate T const (&)[] - T is any type, because decleration of char [] type variable is needed.やはり、T (&)[] という型を decltype なしで宣言できる必用があると思います。Then the type - T (&)[] should be declared without decltype.
Visual Studio/Team Foundation Server/.NET Frameworkツール製品名
再現手順
製品言語
オペレーティング システム
オペレーティング システム言語
実際の結果
期待した結果
Please wait...