ITK  5.0.0
Insight Segmentation and Registration Toolkit
itk::EnableIf< TCondition, TType > Struct Template Reference

#include <itkEnableIf.h>

+ Inheritance diagram for itk::EnableIf< TCondition, TType >:
+ Collaboration diagram for itk::EnableIf< TCondition, TType >:

Detailed Description

template<class TCondition, class TType = void>
struct itk::EnableIf< TCondition, TType >

simplified way to dispose of enable_if.

Template Parameters
TConditionCondition type. It's expected to provide a boolean value through its Value member.
TTypeType to return when the TCondition is (a) true (type).

This overload automatically fetches TCondition value. However, beware, it won't work with standard C++ traits or boost traits. Indeed, this enable_if overload expects the value to follow UpperCamelCase ITK naming policy instead of the standard snake_case policy.

Example:

template< typename TType>
typename EnableIf<
IsSame<TType, typename NumericTraits<TType>::ValueType>,
TType >::Type
GetComponent(const TType pix,
unsigned int itkNotUsed( idx ) ) const
{
return pix;
}
See Also
EnableIfC
DisableIf

Definition at line 104 of file itkEnableIf.h.


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