Skip to content

Commit

Permalink
Renamed can_cast_expr
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanJPhillips authored and smowton committed Sep 19, 2017
1 parent c372eb3 commit 775d9dd
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 62 deletions.
6 changes: 3 additions & 3 deletions src/util/expr_cast.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
/// \tparam T The exprt-derived class to check for
/// \param base Reference to a generic \ref exprt
/// \return true if \a base is of type \a T
template<typename T> bool check_expr_type(const exprt &base);
template<typename T> bool can_cast_expr(const exprt &base);


/// \brief Cast a constant pointer to a generic exprt to a specific derived
Expand Down Expand Up @@ -70,7 +70,7 @@ T expr_dynamic_cast(TExpr *base)
"The template argument T must be derived from exprt.");
if(base == nullptr)
return nullptr;
if(!check_expr_type<TUnderlying>(*base))
if(!can_cast_expr<TUnderlying>(*base))
return nullptr;
T value=static_cast<T>(base);
validate_expr(*value);
Expand Down Expand Up @@ -121,7 +121,7 @@ T expr_dynamic_cast(TExpr &base)
static_assert(
std::is_base_of<exprt, TUnderlying>::value,
"The template argument T must be derived from exprt.");
if(!check_expr_type<TUnderlying>(base))
if(!can_cast_expr<TUnderlying>(base))
throw std::bad_cast();
T value=static_cast<T>(base);
validate_expr(value);
Expand Down
Loading

0 comments on commit 775d9dd

Please sign in to comment.