ComPPare 1.0.0
Loading...
Searching...
No Matches
comppare::internal::policy Namespace Reference

Namespaces

namespace  autopolicy
 

Classes

struct  is_metric_value
 Partial specialisation for not a MetricValue. More...
 
struct  is_metric_value< MetricValue< U > >
 Partial specialisation for any MetricValue and returns true. More...
 
class  MetricValue
 Wrapper for a value that can be streamed to an output stream. More...
 

Concepts

concept  IsMetricValue
 Concept for a MetricValue.
 
concept  ErrorPolicy
 Concept for a valid Error Policy.
 

Functions

template<class EP , class V >
void compute_error (EP &ep, const V &a, const V &b)
 Wrapper function to compute the error using the given instance of the error policy.
 
template<class EP >
bool is_fail (const EP &ep)
 Wrapper function to check if the error policy indicates a failure.
 

Variables

template<typename M >
constexpr bool is_metric_value_v = is_metric_value<std::remove_cvref_t<M>>::value
 Checks if a type is a MetricValue.
 

Function Documentation

◆ compute_error()

template<class EP , class V >
void comppare::internal::policy::compute_error ( EP &  ep,
const V &  a,
const V &  b 
)
inline

Wrapper function to compute the error using the given instance of the error policy.

Template Parameters
EPError Policy type
VValue type
Parameters
epError policy instance
aFirst value
bSecond value

◆ is_fail()

template<class EP >
bool comppare::internal::policy::is_fail ( const EP &  ep)
inline

Wrapper function to check if the error policy indicates a failure.

Template Parameters
EPError Policy type
Parameters
epError policy instance
Returns
true if the error policy indicates a failure, false otherwise

Variable Documentation

◆ is_metric_value_v

template<typename M >
constexpr bool comppare::internal::policy::is_metric_value_v = is_metric_value<std::remove_cvref_t<M>>::value
inlineconstexpr

Checks if a type is a MetricValue.

Template Parameters
MThe type to check

If M is of type MetricValue<T> for some T, then is_metric_value_v<M> is true. Otherwise, it is false. This is implemented using template specialization of the is_metric_value struct.