feat(library/replace_using_ctx): add static_assert
This commit is contained in:
parent
e3b762e909
commit
760f2e15ce
1 changed files with 4 additions and 0 deletions
|
@ -26,6 +26,10 @@ template<typename F, typename P = default_replace_postprocessor>
|
||||||
class replace_using_ctx_fn {
|
class replace_using_ctx_fn {
|
||||||
static_assert(std::is_same<typename std::result_of<F(expr const &, context const &, unsigned)>::type, expr>::value,
|
static_assert(std::is_same<typename std::result_of<F(expr const &, context const &, unsigned)>::type, expr>::value,
|
||||||
"replace_using_ctx_fn: return type of F is not expr");
|
"replace_using_ctx_fn: return type of F is not expr");
|
||||||
|
// the return type of P()(e1, e2) should be void
|
||||||
|
static_assert(std::is_same<typename std::result_of<decltype(std::declval<P>())(expr const &, expr const &)>::type,
|
||||||
|
void>::value,
|
||||||
|
"The return type of P()(e1, e2) is not void");
|
||||||
typedef scoped_map<expr, expr, expr_hash, expr_eqp> cache;
|
typedef scoped_map<expr, expr, expr_hash, expr_eqp> cache;
|
||||||
cache m_cache;
|
cache m_cache;
|
||||||
F m_f;
|
F m_f;
|
||||||
|
|
Loading…
Add table
Reference in a new issue