Pixel data types module
#include "diplib.h"
template<typename T>
dip::IsSampleType struct

For use with std::enable_if to enable templates only for types that are valid for image samples.

Contents

One example usage is as follows:

template< typename T, typename = std::enable_if_t< dip::IsSampleType< T >::value >>
void MyFunction( T value ) { ... }

When defining different versions of the templated function for IsSampleType< T > and !IsSampleType< T >, you’ll need to use the following form:

template< typename T, std::enable_if_t< dip::IsSampleType< T >::value, int > = 0 >
void MyFunction( T value ) { ... }
template< typename T, std::enable_if_t< !dip::IsSampleType< T >::value, int > = 0 >
void MyFunction( T value ) { ... }

Base classes

template<type T>
struct dip::detail::IsSampleType