Search code examples
c++boostcastingoperator-overloadingenable-if

enable_if and conversion operator?


Any chance to use enable_if with a type conversion operator? Seems tricky, since both return type and parameters list are implicit.


Solution

  • dixit the documentation:
    There does not seem to be a way to specify an enabler for a conversion operator. Converting constructors, however, can have enablers as extra default arguments.