From: Jonathan D. Turkanis (technews_at_[hidden])
Date: 2003-12-05 16:03:00
"Jaakko Jarvi" <jajarvi_at_[hidden]> wrote in message
> > Can we add conditional preprocessor guards around the contents of the
> > enable_if.hpp header so that the templates are only defined on
> > supporting compilers?
> Ok, I'm guarding it with BOOST_NO_SFINAE, then any use of enable_if on
> a compiler which does not support SFINAE is an error.
> This is the safe way, (compared to providing dummy definitions that
> do not give the desired behavior).
This could lead to very uninformative compiler errors if someone tries
to use enable_if on an unsupported compiler. I tried it on VC6 and found
that if enable_if is used without explicit namespace qualification I
don't get a single error which clearly states that enable_if is not defined.
This might have been a reason to write enable_if without partial
specialization, even though no compiler supports SFINAE but not partial
spec. A static assert could inform users that SFINAE is not available.
The dummies with static asserts might be a good alternative, to avoid
complicating the main definitions.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk