piranha  0.10
Public Types | Public Member Functions | List of all members
piranha::math::gcd_impl< T, U, typename std::enable_if< std::is_integral< T >::value &&std::is_integral< U >::value >::type > Struct Template Reference

Implementation of piranha::math::gcd() for integral types. More...

#include <piranha/math.hpp>

Public Types

using p_type = decltype(std::declval< const T & >()+std::declval< const U & >())
 The promoted type of T and U.
 

Public Member Functions

p_type operator() (const T &a, const U &b) const
 Call operator. More...
 

Detailed Description

template<typename T, typename U>
struct piranha::math::gcd_impl< T, U, typename std::enable_if< std::is_integral< T >::value &&std::is_integral< U >::value >::type >

Implementation of piranha::math::gcd() for integral types.

This specialisation is enabled when T and U are C++ integral types.

Definition at line 2845 of file math.hpp.

Member Function Documentation

◆ operator()()

template<typename T , typename U >
p_type piranha::math::gcd_impl< T, U, typename std::enable_if< std::is_integral< T >::value &&std::is_integral< U >::value >::type >::operator() ( const T &  a,
const U &  b 
) const
inline

Call operator.

The GCD will be computed via the euclidean algorithm. No overflow check is performed during the computation.

Parameters
athe first operand.
bthe second operand.
Returns
the GCD of a and b.

Definition at line 2858 of file math.hpp.


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