たまに欲しくなるのでメモ。 #include #include #include #include using namespace boost; int main() { // 80%の確率で0, 20%の確率で1 arrayint, 10> probability = {0, 0, 0, 0, 0, 0, 0, 0, 1, 1}; mt19937 gen(static_castunsigned long>(std::time(0)));... 続きを読む
Cygwin に boost ライブラリをインストールして使ってみました。 インストール boost::regex 一致するかどうかの判定 文字列の置き換え boost::regex での正規表現 boost::spirit 簡単な例 セマンティックアクションとプリミティブパーサー 演算子 コメントを読... 続きを読む
つくった。 >>> map(_1 + 1, [1, 2, 3]) [2, 3, 4] >>> map(_1 + _2, [1, 2, 3], [4, 5, 6]) [5, 7, 9] いや、Pythonにはリスト内包表記があるからいらないんだけどさ、boost::lambdaのbinder?のような物を使えば「lambdaの中で代入使わせろ!!1!」という鬱... 続きを読む
% sudo port install boost ---> Building boost with target all Error: Target org.macports.build returned: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_boost/work/boost... 続きを読む