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

VimShell 上で termtter を起動させるとエラー

vimshell% termtter !!!指定されたパスが見つかりません。!!! !!!指定されたパスが見つかりません。!!! !!!指定されたパスが見つかりません。!!! http://termtter.org/ // ここにツイートは出力されている。 (12:43:11) [$au] osyo_manga: hogehoge test Ter…

mpl::switch_

mpl で switch case が出来ないのか調べてみたらすでにあったみたいです。 リファレンスに載っていなかったので気付かなかった……。 #include <boost/static_assert.hpp> #include <boost/type_traits.hpp> #include <boost/mpl/assert.hpp> #include <boost/mpl/switch.hpp> #include <boost/mpl/vector.hpp> #include <boost/mpl/pair.hpp> #include </boost/mpl/pair.hpp></boost/mpl/vector.hpp></boost/mpl/switch.hpp></boost/mpl/assert.hpp></boost/type_traits.hpp></boost/static_assert.hpp>

vim から evernote へポスト

結論からいってしまうと、vim から evernote へポストする事は比較的楽に出来ますが、編集するのはちょっとやっかいです。 と、いうのも Windows のクライアントソフトに付属している ENScript.exe を使用すれば、 XML 形式でのインポートやエクスポートは出…

C++リファレンスサイトcpprefjp

なるものを id:faith_and_brave さんが作成されました。 C++ Reference の日本語版らしいです。 cpprefjp 詳細はこちらへ。 >boostjp Google Groupのメンバであれば編集できるようにしてあります。 との事なのでわたしも何かお手伝い出来ることがあればいい…

cudajp

id:Flast さんがCUDAのコミュニティを作成されたので参加してみました。 cudajp | Google Groups と、いってもCUDAどころかグループにも初参加なのでどうすればいいのか分かりませんが……。 [参照] cudaに日本のコミュニティってないよね - Flast?なにそれ、…

switch case に string を渡したい

C++

何か電波を受信したのでやってみました。 #include <iostream> #include <string> #include <boost/typeof/typeof.hpp> #define switch_(value) \ if( bool __flag__ = true ) \ for( BOOST_AUTO(__value__, value) ; __flag__ ; __flag__ = false ) #define case_(__case__) \ if( (!(__flag__ = !(__va</boost/typeof/typeof.hpp></string></iostream>…

定数と型で処理を変えたい

定数だった場合に、boost::integral_constant でラップして返すようなメタ関数が欲しかったのでやってみました。 #include <boost/static_assert.hpp> #include <boost/type_traits/is_same.hpp> #include <boost/type_traits/integral_constant.hpp> #include <boost/utility/enable_if.hpp> #include <boost/mpl/bool.hpp> #include <boost/mpl/identity.hpp> name…</boost/mpl/identity.hpp></boost/mpl/bool.hpp></boost/utility/enable_if.hpp></boost/type_traits/integral_constant.hpp></boost/type_traits/is_same.hpp></boost/static_assert.hpp>

違う名前でも取得したい

例えば、関数オブジェクトの戻り値型を定義する場合、result や result_type, もしくは、result_t 等、意味は同じでも別の名前で定義される可能性があります。 struct func1{ typedef int reuslt_type; /* ... */ }; struct func2{ typedef float result; //…

mpl::map に特化した mpl::find_if

特化というか、単に first で判断して、second を返すような処理が欲しかったので書いてみました。 久々にコーディングするので若干怪しい。 #include <boost/static_assert.hpp> #include <boost/type_traits/is_same.hpp> #include <boost/mpl/assert.hpp> #include <boost/mpl/map.hpp> #include <boost/mpl/pair.hpp> #include <boost/mpl/find_if.hpp> #include </boost/mpl/find_if.hpp></boost/mpl/pair.hpp></boost/mpl/map.hpp></boost/mpl/assert.hpp></boost/type_traits/is_same.hpp></boost/static_assert.hpp>