Skip to content

Commit 37f69b2

Browse files
author
Daniel Kroening
committed
added to_mathematical_function_type
1 parent 7b670cd commit 37f69b2

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

src/util/std_types.h

+27
Original file line numberDiff line numberDiff line change
@@ -1752,4 +1752,31 @@ class mathematical_function_typet:public typet
17521752
}
17531753
};
17541754

1755+
/*! \brief Cast a generic typet to a \ref mathematical_function_typet
1756+
*
1757+
* This is an unchecked conversion. \a type must be known to be \ref
1758+
* mathematical_function_typet.
1759+
*
1760+
* \param type Source type
1761+
* \return Object of type \ref mathematical_function_typet
1762+
*
1763+
* \ingroup gr_std_types
1764+
*/
1765+
inline const mathematical_function_typet &
1766+
to_mathematical_function_type(const typet &type)
1767+
{
1768+
PRECONDITION(type.id()==ID_mathematical_function);
1769+
return static_cast<const mathematical_function_typet &>(type);
1770+
}
1771+
1772+
/*! \copydoc to_mathematical_function_type(const typet &)
1773+
* \ingroup gr_std_types
1774+
*/
1775+
inline mathematical_function_typet &
1776+
to_mathematical_function_type(typet &type)
1777+
{
1778+
PRECONDITION(type.id()==ID_mathematical_function);
1779+
return static_cast<mathematical_function_typet &>(type);
1780+
}
1781+
17551782
#endif // CPROVER_UTIL_STD_TYPES_H

0 commit comments

Comments
 (0)