Boost logo

Boost :

From: David Abrahams (david.abrahams_at_[hidden])
Date: 2001-12-15 17:59:14


Mat, could you describe this technique in a patch for

www.boost.org/more/microsoft_vcpp.html

??

I will be very glad to be able to check it into CVS.

----- Original Message -----
From: "Mat Marcus" <mmarcus_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Saturday, December 15, 2001 5:36 PM
Subject: Re: [boost] compile-time partial port of bind

> At 11:52 PM +0200 12/15/01, Peter Dimov wrote:
> >From: "Wilka" <wilka_at_[hidden]>
> >> > See the end of the message for a starting point. This works
> >> > on MSVC;
> >>
> >> Really? I get "fatal error C1001: INTERNAL COMPILER ERROR" :) MSVC6
SP5,
> >> are you using 7?
> >
> >Yes. MSVC 6 must die. ;-)
>
>
> Agreed. But until then... I don't have access to VC6 at the moment
> but it is possible that this is just a case of the "dependent
> template typedef bug". Did you try something like:
>
> // EvalMF.h
> #include "boost/mpl/mpl_config.h"
> template <class QuotedMF, class B1, class B2>
> struct EvalMF2
> {
> #ifdef BOOST_MSVC
> // based on the (non-conforming) MSVC trick from MPL
>
> template<bool>
> struct QuotedMF_VC : QuotedMF {};
>
> file://illegal C++ which causes VC to admit that QuotedMF_VC
> file://can have a nested template:
>
> template<>
> struct QuotedMF_VC<true>
> {template<class, class> struct apply; };
>
> typedef typename QuotedMF_VC<
> ::boost::mpl::detail::msvc_never_true<QuotedMF>::value
> >::template apply <B1, B2>::type type;
> };
> #else
> typedef typename QuotedMF::
> template apply <B1, B2>::type type;
> #endif
> };
>
> template <class QuotedMF, class B1, class B2, class B3, class B4>
> struct EvalMF4
> {
> #ifdef BOOST_MSVC
> // based on the (non-conforming) MSVC trick from MPL
>
> template<bool>
> struct QuotedMF_VC : QuotedMF {};
>
> file://illegal C++ which causes VC to admit that QuotedMF_VC
> file://can have a nested template:
>
> template<>
> struct QuotedMF_VC<true>
> {template<class, class, class, class> struct apply; };
>
> typedef typename QuotedMF_VC<
> ::boost::mpl::detail::msvc_never_true<QuotedMF>::value
> >::template apply <B1, B2, B3, B4>::type type;
> };
> #else
> typedef typename QuotedMF::
> template apply <B1, B2, B3, B4>::type type;
> #endif
> };
>
> file://end EvalMF.h
>
> Then rewrite bind2:
>
>
> // ...
>
> // #Include "EvalMF.h"
>
> template<class F, class A1, class A2> struct bind2
> {
> typedef bind2 type;
>
> template<class B1 = _missing, class B2 = _missing, class B3 = _missing,
> class B4 = _missing> struct apply
> {
> typedef typename EvalMF4<_bi::select<A1>,B1, B2, B3, B4>::type a1;
> typedef typename EvalMF4<_bi::select<A2>,B1, B2, B3, B4>::type a2;
> typedef typename EvalMF2<F, a1, a2>::type type;
> };
> };
>
>
> Info: http://www.boost.org Send unsubscribe requests to:
<mailto:boost-unsubscribe_at_[hidden]>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk