Super4PCS Library  V1.1.2(719f5c0)
GlobalRegistration::Utils::internal::IndexValidator< enable > Struct Template Reference

Helper structure used to (conditionnaly) validate indices. More...

+ Collaboration diagram for GlobalRegistration::Utils::internal::IndexValidator< enable >:

Public Member Functions

template<>
constexpr IndexT validate (const IndexT &n, const SizeT &gsize)
 
template<>
constexpr IndexT validate (const IndexT &n, const SizeT &)
 

Static Public Member Functions

template<class IndexT , class SizeT >
static constexpr IndexT validate (const IndexT &n, const SizeT &gsize)
 Check if n is within [0:gsize] if enable=true. More...
 
template<class IndexT , class SizeT >
static constexpr bool _test (const IndexT &n, const SizeT &gsize)
 Test used internally to validate the input index. More...
 

Detailed Description

template<bool enable>
struct GlobalRegistration::Utils::internal::IndexValidator< enable >

Helper structure used to (conditionnaly) validate indices.

The template parameter enable allows to control the validation, without overload when the validation is disabled.

Throw std::out_of_range exception when the validation is enabled and an invalid case is detected

Member Function Documentation

◆ _test()

template<bool enable>
template<class IndexT , class SizeT >
static constexpr bool GlobalRegistration::Utils::internal::IndexValidator< enable >::_test ( const IndexT &  n,
const SizeT &  gsize 
)
inlinestatic

Test used internally to validate the input index.

◆ validate() [1/3]

template<bool enable>
template<class IndexT , class SizeT >
static constexpr IndexT GlobalRegistration::Utils::internal::IndexValidator< enable >::validate ( const IndexT &  n,
const SizeT &  gsize 
)
inlinestatic

Check if n is within [0:gsize] if enable=true.

Exceptions
std::out_of_range

◆ validate() [2/3]

template<>
constexpr IndexT GlobalRegistration::Utils::internal::IndexValidator< true >::validate ( const IndexT &  n,
const SizeT &  gsize 
)
+ Here is the call graph for this function:

◆ validate() [3/3]

template<>
constexpr IndexT GlobalRegistration::Utils::internal::IndexValidator< false >::validate ( const IndexT &  n,
const SizeT &   
)