[C++-sig] Re: difficulty with has_back_reference example

David Abrahams dave at boost-consulting.com
Sat Jul 17 21:21:27 CEST 2004

David Abrahams <dave at boost-consulting.com> writes:

> Jonathan Brandmeyer <jbrandmeyer at earthlink.net> writes:
>> I'm trying to get the has_back_reference example to work.  I started
>> with the example in the reference manual, which has some errors.  I
>> removed the const qualifier from the free function Y_self, fixed the
>> name of the 'x' variable in structs X and Y to 'm_x', and fixed the
>> semicolon usage in has_back_reference<X>.  However, that still isn't
>> enough to get it to compile.
>> I have attached the touched-up example, and the error message (GNU G++
>> 3.4.0 on Linux).  This doesn't compile with G++ 3.3.4, either.
> See libs/python/test/back_reference.cpp in your boost distribution,
> which does compile.  Would you mind posting a patch to correct the
> documentation (or just checking in the fix once you know what it is
> if you have checkin privs)?

The problem is that has_back_reference<T> needs to be a metafunction.

Dave Abrahams
Boost Consulting

More information about the Cplusplus-sig mailing list