Skip to content

Instantly share code, notes, and snippets.

@nyuichi
Created August 11, 2012 03:01
Show Gist options
  • Save nyuichi/3320261 to your computer and use it in GitHub Desktop.
Save nyuichi/3320261 to your computer and use it in GitHub Desktop.
delimited continuation in post increment
// 後置インクリメントは限定継続を使って表せるし、
// 逆に限定継続の一番身近な例が後置インクリメント
// http://www.kmonos.net/pub/Presen/fltv/FLTV.pdf
class BigInt {
BigInt&/<noreturn> operator++(int) {
var f = rest_of_full_expression();
var g = after_full_expression();
var r = f(*this);
this->incr();
g(r);
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment