2014-08-01から1ヶ月間の記事一覧

再帰深度を抑えた畳込み関数

FTMPのメタ関数で使われている畳込みの実装アプローチをソースコードと勉強会で発表された資料を参考に理解した(気になった)ので、constexprで再現してみました。パックの分割に当たる操作と、相互再帰を利用して畳み込みがうまく実現されています。foldlとf…

N4072: Fixed Size Parameter Packs は期待出来る

N4072: Fixed Size Parameter Packsという提案が出ています。 参考記事: 本の虫: 2014-07 post Rapperswil mailingのレビュー: N4070-N4079 そこにこのような例があります。 template<unsigned int N, unsigned int M> void f(int...[N], int...[M]) {} f<2>(1,2,3); // M is deduced as 1. (</unsigned>…

Is there a name for this tuple-creation idiom?

たぷる系。面白いと思ったので紹介。 c++ - Is there a name for this tuple-creation idiom? - Stack Overflow

メモ

もう少しマシに出来ないだろうか http://melpon.org/wandbox/permlink/ECTzA3hv0pkHUlFo

overloaded_function, fusedの関数ポインタ対応を済ませた

overloaded_function, fusedの関数ポインタ対応を済ませました。 これでoverloaded_function, fusedの当面の目標を一通り実装しました。 また別のネタを模索しようと思います。

overloaded_function, fusedがラムダ式に対応した

ちょっと頑張ってmake_overloadやmake_fusedでラムダ式も扱えるようにしました。 https://github.com/fimbul/shiro/blob/master/shiro/functional/overloaded_function.hpp https://github.com/fimbul/shiro/blob/master/shiro/tuple/fused.hpp これで以下の…

overloaded_function, fusedを実装した。

実験的なライブラリなので、後々仕様変更などをするかもしれませんが、とりあえずshiro::tupleに対して使えるfusedまで実装しました。現状overloaded_functionが扱えるのは関数オブジェクトだけですが、のちのちboost::overloaded_functionのように関数オブ…

index_tuple_catを書いた

typename index_tuple_cat<index_tuple<Indices1...>, index_tuple<Indices2...>, ..., index_tuple<IndicesN...>>::typeがindex_tuple<Indices1..., Indices2..., ..., IndicesN...>となるようなメタ関数を書きました。 https://github.com/fimbul/shiro/blob/master/shiro/utility/index_tuple_cat.hpp</indices1...,></indicesn...></indices2...></index_tuple<indices1...>