Last active
January 29, 2017 14:25
-
-
Save deque-blog/8fdc9de51488825e23c0010a91887a1f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
template <typename T> | |
int const* get_as_cst(expression_r<T> const& e) | |
{ | |
return boost::get<int>(&e); | |
} | |
template <typename T> | |
id const* get_as_var(expression_r<T> const& e) | |
{ | |
return boost::get<id>(&e); | |
} | |
template <typename T> | |
add_op<T> const* get_as_add(expression_r<T> const& e) | |
{ | |
return boost::get<add_op<T>>(&e); | |
} | |
template <typename T> | |
mul_op<T> const* get_as_mul(expression_r<T> const& e) | |
{ | |
return boost::get<mul_op<T>>(&e); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment