piranha  0.10
piranha::math::is_unitary_impl< T, typename > Struct Template Reference

Default functor for the implementation of piranha::math::is_unitary(). 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_unitary_impl< T, typename >

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

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 179 of file math.hpp.

## ◆ operator()()

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

Call operator.

Note
This template method is enabled only if U can be constructed from int and U is equality comparable.

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

Parameters
 x argument to be tested.
Returns
true if x is equal to 1, false otherwise.
Exceptions
 unspecified any exception thrown by the construction or comparison of instances of type U or by the conversion of the result to bool.

Definition at line 202 of file math.hpp.

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