Skip to content

Instantly share code, notes, and snippets.

@TheZoq2
Created March 12, 2019 09:03
Show Gist options
  • Save TheZoq2/21cd4e7ed9ea705bea180c1fe33c0f2a to your computer and use it in GitHub Desktop.
Save TheZoq2/21cd4e7ed9ea705bea180c1fe33c0f2a to your computer and use it in GitHub Desktop.
class Node;
class FractionalNode {
virtual double min() = 0;
virtual double max() = 0;
};
class BooleanNode;
template<class Result>
class If : Result {
If(BooleanNode condition, Result on_true, Result on_false) {
static_assert(Result is node);
}
// If Result is FractionalNode, impl min, max
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment