Macro
SEQAN_FUNC_ENABLE_IF
Bind the visibility of a function to an expression.
SEQAN_FUNC_ENABLE_IF(cond, retType)
Include Headers
seqan/basic.h
Parameters
cond
Boolean type. If True or a metafunction that returns True, the following function is visible, otherwise not.
Remarks: The boolean value must be available at compile-time, e.g. sizeof(T)>4.
retType
Function return type, e.g. typename Size<T>::Type or void.
Remarks
This macro allows to bind the visibility of a function to a boolean expression by using the SFINAE principle. It can be used in a function declaration/definition instead of its return type. As constructors have no return types, they must be disabled with SEQAN_CTOR_ENABLE_IF.
Examples
template <typename TContainer>
SEQAN_FUNC_ENABLE_IF(
    IsContainer<TContainer>,
    typename Size<TContainer>::Type)
length(TContainer & cont)
{
    SEQAN_CONCEPT_ASSERT((ContainerConcept<TContainer>));
    return end(cont) - begin(cont);
}
See Also
SeqAn - Sequence Analysis Library - www.seqan.de
 

Page built @2013/07/11 09:12:37