1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

std::vector と std::valarray はコンストラクタの引数が逆順なんだね...

Last updated at Posted at 2015-05-30
std::vector<T>::vector(SIZE, INITIAL_VALUE);
// whereas...
std::valarray<T>::valarray(INITIAL_VALUE, SIZE);

しかも、<bool> で特殊化された実装に対して、普通に期待する型チェックをやってくれなかったので(gcc (Debian 4.9.2-16) 4.9.2)、

valarray<bool> my_sugoi_bitvector(false, N);

とか書くとメモリが SEGV になってしぬ (過去形)

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?