Boost logo

Proto :

Subject: [proto] invalid use of incomplete type 'detail::uncvref<...>'
From: Hossein Haeri (powerprogman_at_[hidden])
Date: 2011-02-21 13:45:51


Dear all,

[GCC 4.5.1, MinGW32, WinXPSP3, Boost 1.42]

I have an application in which the following two pieces of syntax come handy (where F and G are templatised function objects):

1) _1 >> F<...>() >> G<...>() -- to be equivalent with F(G(x)) when called with _1 == x.

2) (_1 || _2) >> F<...>() -- to be equivalent with F(x, y) when called with _1 == x and _2 == y.

The same syntax for F and G above needs also to work for ordinary functions.

I used Proto to give my F's and G's the above desired compositional syntax. And, it actually works quite well with ordinary functions but becomes quite hairy for certain function objects. For example, I have the following test-cases where everyone behaves themselves except the line marked with ***:

EW1<InpPool, GameState, AmmoMsg>() >> &plus1;
EW1<InpPool, GameState, AmmoMsg>() >> Plus1();

(EW1<InpPool, GameState, AmmoMsg>() || EW1<InpPool, GameState, AmmoMsg>()) >> Plus2();//***
(EW1<InpPool, GameState, AmmoMsg>() || EW1<InpPool, GameState, AmmoMsg>()) >> &plus2;

When I compile the *** line, I get a giant spew attached in a file called Err.txt. For those kind fellows on the list who'd like to see the actual code as well, a *very small* zip file is attached to this posting. (The zip file contains 2 .cpp's as well 5 .hpp's which simply need to be built altogether in a single directory.)

Anyone having any ideas please?

TIA,
--Hossein




Proto list run by eric at boostpro.com