This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// apply を利用した実装メモ | |
// primary | |
template <typename Ret, typename Args> | |
struct RetType; | |
template <typename Ret> | |
struct RetType<Ret, tuple<>> { | |
typedef Ret type; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// せつめい | |
// C++ 0x で関数と引数を pack したタプルから関数適用を行う apply を実装した。 | |
// apply を実装するには tuple の値を variadic arguments に変換する必要がある。 | |
// 束縛済み引数の数で特殊化してやる。0 なら関数を呼ぶ。 1 以上の場合は値を一つずつ積んでいく。 | |
// 返値型を求めようと auto impl(...) -> decltype(impl(...)) のようなコードを書くのは正しくない。 | |
// impl の宣言に impl を利用することは当然できない。それが実際には異なるパラメータを持つ関数テンプレートであったとしても… | |
// declval を使って fun の返値を求めることで解決する。 | |
#include <tuple> | |
#include <type_traits> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// PLUGIN_INFO//{{{ | |
var PLUGIN_INFO = | |
<VimperatorPlugin> | |
<name>{NAME}</name> | |
<description>character hint mode.</description> | |
<author mail="konbu.komuro@gmail.com" homepage="http://d.hatena.ne.jp/hogelog/">hogelog</author> | |
<version>0.3.2</version> | |
<minVersion>2.3pre 2010/01/26</minVersion> | |
<maxVersion>2.4pre</maxVersion> | |
<updateURL>http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk/char-hints-mod2.js</updateURL> |
NewerOlder