2011-05-01から1ヶ月間の記事一覧

gccでzero-sized array

gccとVC++にて、以下のコードを試してみました #include <iostream> int main() { char dummy[0]; return 0; } と #include <iostream> int main() { static_assert( ( 0 == 1 ), "bad" ); return 0; } 結果として、上はVC++のみ、下はVC++、gccともにエラーでした。上はgccにて-</iostream></iostream>…

ボゴソートできたよー

SleepSortのTLにボゴソートが見え隠れしてたので(主におたっくすさん(@otaks21)辺りに)皆がSleepSort実装している間に何となくやってました #include<iostream> #include<random> #include<algorithm> #include<boost/array.hpp> template<class RandomGen> class RandomGenerator { public: RandomGenerator(const RandomGen</class></boost/array.hpp></algorithm></random></iostream>…