| Macro SEQAN_CTOR_ENABLE_IF Bind the visibility of a constructor to an expression. SEQAN_CTOR_ENABLE_IF(cond) 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.
Remarks This macro allows to bind the visibility of a constructor to a boolean expression by using the SFINAE principle for an optional argument with default value. It can be used as the last dummy-argument of a constructor. To avoid an unused argument warning, call ignoreUnusedVariableWarning(dummy) in the constructor's body. Examples Here is an example on how to use the macro:
1 | template <typename T>
2 | EnableIfExample(T const & n, SEQAN_CTOR_ENABLE_IF(seqan::Is<seqan::IntegerConcept<T> >)) :
3 | num(0)
4 | {
5 | seqan::ignoreUnusedVariableWarning(dummy);
6 | }
Snippet from "enable_if.cpp" SeqAn - Sequence Analysis Library - www.seqan.de

Page built @2014/10/13 16:12:59