Boost logo

Boost :

From: Gennaro Prota (gennaro_prota_at_[hidden])
Date: 2003-01-12 21:21:18


On Sun, 12 Jan 2003 17:34:51 -0500, David Abrahams
<dave_at_[hidden]> wrote:

>The latter. It was just an experiment. Fortunately, nothing I'm
>doing depends very much on it. It was prompted by the fact that
>Borland 5.51 can handle enable_if, but not in a templated constructor:
>
>template <class T>
>struct X
>{
> template <class U>
> X(X<U> const&, typename enable_if<some_property_of<U>::value, int*>::type = 0);
>}
>
>The parser chokes on the first '<' inside the parens.

Dave, just a quick remark before I really go to bed (it's late night
here). I suspect that, even if you get rid of the parsing error,
Borland will give you problems when matching X's constructor. Anyhow,
I would give it a try. From what I've seen, using that compiler
occasionally, these sorts of parser bugs depends a lot on a) what the
compiler 'knows' about the names that appear in the declaration (for
instance it may choke at different points depending on whether you
have a declaration of enable_if before the definition of X or not)
and, fortunately, on b) parentheses. I wouldn't be surprised if the
above compiled by simply putting the expression

    some_property_of<U>::value

in parentheses. But I don't have your full code so I can't say.

Genny.


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