私は、コンストラクタガットVSコンパイラの警告C4239 STDをキャストしようとしている::ベクトル<はstd ::ペア<T, U>>
Foo::Foo(std::vector<std::pair<int, char>> &Data)
: //Initialization list
{
//Some other initialization
}
のように書かれており、私はそれを呼び出すようにしようとしたクラスFoo
を持っています
Foo(std::vector<std::pair<int, char>>
{
{10, 'a'}
});
と私のコードでは、コンパイラは、私に言ってC4239を与えること
nonstandard extension used: 'argument': conversion from
'std::vector<std::pair<int,char>,std::allocator<_Ty>>' to
'std::vector<std::pair<int,char>,std::allocator<_Ty>> &'
私はこのメッセージを理解していますが、コンパイラがそのような変換を喜ばないのはなぜですか?
ありがとうございます。
なぜ 'std :: make_pair'ではないのですか? –