C++ Library Extensions 2022.12.09
To help learn modern C++ programming
tpf::ncrnpr::simple_positive_rational< NumberType, typename > Class Template Reference

#include <tpf_ncrnpr.hpp>

Public Types

using number_t = NumberType
 

Public Member Functions

 simple_positive_rational ()
 
 simple_positive_rational (number_t p)
 
template<typename Type >
 operator Type () const
 
 simple_positive_rational (number_t p, number_t q)
 
 simple_positive_rational (const simple_positive_rational &)=default
 
simple_positive_rationaloperator= (const simple_positive_rational &)=default
 
simple_positive_rationaloperator*= (number_t n)
 
simple_positive_rationaloperator*= (simple_positive_rational r)
 

Friends

template<typename RationalType >
decltype(auto) operator* (RationalType &&r, number_t n)
 
template<typename RationalType1 , typename RationalType2 >
decltype(auto) operator* (RationalType1 &&r1, RationalType1 &&r2)
 
std::ostream & operator<< (std::ostream &os, const simple_positive_rational &r)
 

Detailed Description

template<typename NumberType, typename = std::enable_if_t<is_unsigned_integer_v<NumberType>>>
class tpf::ncrnpr::simple_positive_rational< NumberType, typename >

Definition at line 270 of file tpf_ncrnpr.hpp.

Member Typedef Documentation

◆ number_t

template<typename NumberType , typename = std::enable_if_t<is_unsigned_integer_v<NumberType>>>
using tpf::ncrnpr::simple_positive_rational< NumberType, typename >::number_t = NumberType

Definition at line 273 of file tpf_ncrnpr.hpp.

Constructor & Destructor Documentation

◆ simple_positive_rational() [1/4]

template<typename NumberType , typename = std::enable_if_t<is_unsigned_integer_v<NumberType>>>
tpf::ncrnpr::simple_positive_rational< NumberType, typename >::simple_positive_rational ( )
inline

Definition at line 283 of file tpf_ncrnpr.hpp.

◆ simple_positive_rational() [2/4]

template<typename NumberType , typename = std::enable_if_t<is_unsigned_integer_v<NumberType>>>
tpf::ncrnpr::simple_positive_rational< NumberType, typename >::simple_positive_rational ( number_t  p)
inline

Definition at line 284 of file tpf_ncrnpr.hpp.

◆ simple_positive_rational() [3/4]

template<typename NumberType , typename = std::enable_if_t<is_unsigned_integer_v<NumberType>>>
tpf::ncrnpr::simple_positive_rational< NumberType, typename >::simple_positive_rational ( number_t  p,
number_t  q 
)
inline

Definition at line 289 of file tpf_ncrnpr.hpp.

Here is the call graph for this function:

◆ simple_positive_rational() [4/4]

template<typename NumberType , typename = std::enable_if_t<is_unsigned_integer_v<NumberType>>>
tpf::ncrnpr::simple_positive_rational< NumberType, typename >::simple_positive_rational ( const simple_positive_rational< NumberType, typename > &  )
default

Member Function Documentation

◆ operator Type()

template<typename NumberType , typename = std::enable_if_t<is_unsigned_integer_v<NumberType>>>
template<typename Type >
tpf::ncrnpr::simple_positive_rational< NumberType, typename >::operator Type ( ) const
inline

Definition at line 287 of file tpf_ncrnpr.hpp.

◆ operator*=() [1/2]

template<typename NumberType , typename = std::enable_if_t<is_unsigned_integer_v<NumberType>>>
simple_positive_rational & tpf::ncrnpr::simple_positive_rational< NumberType, typename >::operator*= ( number_t  n)
inline

Definition at line 299 of file tpf_ncrnpr.hpp.

Here is the call graph for this function:

◆ operator*=() [2/2]

template<typename NumberType , typename = std::enable_if_t<is_unsigned_integer_v<NumberType>>>
simple_positive_rational & tpf::ncrnpr::simple_positive_rational< NumberType, typename >::operator*= ( simple_positive_rational< NumberType, typename >  r)
inline

Definition at line 314 of file tpf_ncrnpr.hpp.

Here is the call graph for this function:

◆ operator=()

template<typename NumberType , typename = std::enable_if_t<is_unsigned_integer_v<NumberType>>>
simple_positive_rational & tpf::ncrnpr::simple_positive_rational< NumberType, typename >::operator= ( const simple_positive_rational< NumberType, typename > &  )
default

Friends And Related Function Documentation

◆ operator* [1/2]

template<typename NumberType , typename = std::enable_if_t<is_unsigned_integer_v<NumberType>>>
template<typename RationalType >
decltype(auto) operator* ( RationalType &&  r,
number_t  n 
)
friend

Definition at line 335 of file tpf_ncrnpr.hpp.

◆ operator* [2/2]

template<typename NumberType , typename = std::enable_if_t<is_unsigned_integer_v<NumberType>>>
template<typename RationalType1 , typename RationalType2 >
decltype(auto) operator* ( RationalType1 &&  r1,
RationalType1 &&  r2 
)
friend

Definition at line 355 of file tpf_ncrnpr.hpp.

◆ operator<<

template<typename NumberType , typename = std::enable_if_t<is_unsigned_integer_v<NumberType>>>
std::ostream & operator<< ( std::ostream &  os,
const simple_positive_rational< NumberType, typename > &  r 
)
friend

Definition at line 380 of file tpf_ncrnpr.hpp.


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