Visual C++ 2010 Expressを使用しています。I use Visual C++ 2010 Express.どのような引数の参照でも受け取れる関数 template<typename T> f(T const &) を作ろうとしていた所、サイズが0または未定の配列である、char [] 型の変数を受け取れないことがわかりました。When I make a function "template<typename T> f(T const &)" which can recieve any reference of argument, I notice it cannot recieve a variable of 0 size array / pending size array - char [].char [] が char * に暗黙にキャストされ、char * が char *const & に暗黙にキャストされて f(T const &) に渡されると意図しました。I intend to convert char [] to char * implicitly, and to convert char * to char *const & implicitly.しかし、なぜか、char [] は char const (&)[1] への変換が試みられたようです。But, char [] was tried to convert char const (&)[1] somehow.char *const & または char const (&)[] のどちらかに暗黙に変換されるべきではないでしょうか?Should it be converted to char *const & or char const (&)[]?
Visual Studio/Team Foundation Server/.NET Frameworkツール製品名
再現手順
製品言語
オペレーティング システム
オペレーティング システム言語
実際の結果
期待した結果
Please wait...