1 Aug 2009 01:36
Re: request: BOOST_NO_SFINAE_EXPR macro
Beman Dawes <bdawes <at> acm.org>
2009-07-31 23:36:02 GMT
2009-07-31 23:36:02 GMT
On Fri, Jul 31, 2009 at 11:52 AM, Simonson, Lucanus J<lucanus.j.simonson <at> intel.com> wrote: > Beman Dawes wrote: >> On Thu, Jul 30, 2009 at 10:20 AM, Mathias >> Gaunard<mathias.gaunard <at> ens-lyon.org> wrote: >>> It would be very nice if Boost.Config provided the >>> BOOST_NO_SFINAE_EXPR macro, that would be defined if the compiler >>> does not support SFINAE applied to expressions. >>> http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2634.html >>> >>> GCC supports this feature since 4.4 both for C++03 and C++0x for >>> example. >> >> Yes, such a macro is needed > > So we could do this instead of use mpl and? > > template <typename T1, typename T2> > enable_if_c<is_a_A<T1>::value && is_a_B<T2>::value>::type foo(); > >> Also, it turns out that the ability to provide a default template >> parameter for function templates markedly clarifies code using >> enable_if. (I learned this Howard Hinnant, but I think he may have >> gotten the idea from Peter Dimov.) > > This sounds interesting. Can you explain how? The example from Howard is below. Note that the enable_if code is moved out of the function signature and into a default template parameter.(Continue reading)
, I didn't notice the ping at all when I got
back this week. And unfortunately I won't have time for much Boost
related for some weeks, as I have this thing called "my wedding" to
worry about next week
RSS Feed