[boost]Boost C++ Libraryのお勉強その9

boost::hash

hash関数。興味ないので飛ばす。

boost::fusion

tupleは各要素の型が違うのでSTLアルゴリズムが使えないので、その辺に対応したもの。

#include <iostream>
#include <string>

#include <boost/fusion/tuple.hpp>
#include <boost/fusion/algorithm.hpp>

struct Print
{
    template < typename T > void operator () (T & x) const
    {
        std::cout << x << std::endl;
    }
};

int main(void)
{
    boost::fusion::tuple < int, std::string > t(1, "alfa");
    boost::fusion::for_each(t, Print());

    return 0;
}
1
alfa

discards qualifiersとかいうコンパイルエラーが、関数をconstにしてないという意味なのに気がつかず、かなり時間を消費してしまった。

boost::gil

Generic Image Libraryの略。ドキュメントが凄くて、音声付き(英語だけど)のスライドでGILを紹介する動画がある。ゆっくりはっきり喋ってるので聞き取りやすい。
それはそれとして、GILってadobeの人が作ってるらしくadobeがスポンサみたい。ドキュメントのトップにロゴがでてるけど、boostってそういうのもありなのか?

なんか面倒そうなのでコードはパス。