
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Monday 13 April 2009, Peter Dimov wrote:
I haven't. What seems to be happening is that when you pass _1, which is
inline arg<1> _1() { .. }
to A1 const& a1, A1 is properly deduced as a function type, but the const is not dropped, as it should be; instead, the type of a1 becomes arg<1> (&)() const (which is illegal BTW). When this a1 is passed (by value) to boost::bind, it decays to its corresponding pointer type, arg<1> (*)() const - which is also illegal. :-)
A workaround is to use pass by value instead of A1 const&.
Yes, that seems to fix it. If it is at all helpful, I've attached a more minimal test program that triggers the bug with g++ 4.0.1 (compiles fine with g++ 4.3.2). Changing the placeholder to be passed by value makes the compile error go away. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAknjjc8ACgkQ5vihyNWuA4VJugCfeqgL5yxusz9WXYnIgbGnoyyW srIAoIr19iV0HLnezajCYI/EU0uZhT56 =9OIZ -----END PGP SIGNATURE-----