std::fill のメモ書き
std::fill でポインタ配列初期化時
#include <vector> int main(void) { Foo* foo[10]; std::fill(foo,foo+10,NULL); }
error C2440: '=' : 'const int' から 'xxx' に変換できません。
とエラーが表示されます。
NULLの定義は 0 だったので
std::fill(foo,foo+10,(Foo*)NULL);
キャストすれば大丈夫です
std::fill でポインタ配列初期化時
#include <vector> int main(void) { Foo* foo[10]; std::fill(foo,foo+10,NULL); }
error C2440: '=' : 'const int' から 'xxx' に変換できません。
とエラーが表示されます。
NULLの定義は 0 だったので
std::fill(foo,foo+10,(Foo*)NULL);
キャストすれば大丈夫です