Skip to content

Instantly share code, notes, and snippets.

View patxitron's full-sized avatar

Francisco J. Lazur patxitron

  • Vitoria-Gasteiz
View GitHub Profile
@RossBencina
RossBencina / MyCoroutine.cpp
Last active August 29, 2015 14:01
C++ Coroutine Using Template
// Template-based Coroutine continuation idea by Ross Bencina <[email protected]> May 2014.
// see: https://groups.google.com/forum/#!topic/comp.lang.c++.moderated/ryhWI6cX3Ko
#include <iostream>
class MyCoroutine {
typedef MyCoroutine this_t;
typedef bool (this_t::*coroutine_fn_t) ();
coroutine_fn_t next_;