2009-01-10から1日間の記事一覧

簡単なキャッシュ(gcc/andlinux)

C++

typenameの罠に見事に嵌った。VCって意外と賢かったのか… #include <iostream> #include <string> #include <sstream> #include <map> #include <boost/asio.hpp> #include <boost/timer.hpp> using namespace std; template <class I, class O> class Cache { map<I, O> m_; O (*f_)(I x); public: Cache(O (*f)(I x)): f_(f) {} O operator ()(…</i,></class></boost/timer.hpp></boost/asio.hpp></map></sstream></string></iostream>