Macro
SEQAN_FUNC_ENABLE_IF
Bind the visibility of a function to an expression.
Include Headers
seqan/basic.h
Parameters
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. | |
Function return type, e.g. |
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
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