piranha  0.10
Public Member Functions | List of all members
piranha::math::is_zero_impl< T, typename > Struct Template Reference

Default functor for the implementation of piranha::math::is_zero(). More...

#include <piranha/math.hpp>

Public Member Functions

template<typename U , enabler< U > = 0>
bool operator() (const U &x) const
 Call operator. More...
 

Detailed Description

template<typename T, typename = void>
struct piranha::math::is_zero_impl< T, typename >

Default functor for the implementation of piranha::math::is_zero().

This functor should be specialised via the std::enable_if mechanism. The default implementation defines a call operator which is enabled only if the argument type is constructible from the C++ int type and T is equality comparable.

Definition at line 69 of file math.hpp.

Member Function Documentation

◆ operator()()

template<typename T , typename = void>
template<typename U , enabler< U > = 0>
bool piranha::math::is_zero_impl< T, typename >::operator() ( const U &  x) const
inline

Call operator.

Note
This operator is enabled only if U is constructible from int and equality-comparable.

The operator will compare x to an instance of U constructed from the literal 0.

Parameters
xargument to be tested.
Returns
true if x is zero, false otherwise.
Exceptions
unspecifiedany exception thrown by the construction or comparison of instances of type U, or by the conversion of the result of the comparison to bool.

Definition at line 94 of file math.hpp.


The documentation for this struct was generated from the following file: