[C++-sig] Re: difficulty with has_back_reference example
Jonathan Brandmeyer
jbrandmeyer at earthlink.net
Sun Jul 18 16:37:51 CEST 2004
On Sat, 2004-07-17 at 15:21, David Abrahams wrote:
> David Abrahams <dave at boost-consulting.com> writes:
> > 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.
Thanks for the diagnosis. Rather than raise the requirement of
has_back_reference<T> from being a traits class to a predicate
metafunction, would you accept the following patch? It basically
performs a metacast from a predicate traits struct to a metafuction. I
will be happy to apply the right patches in either case.
Thanks,
Jonathan
===================================================================
RCS file: /cvsroot/boost/boost/boost/python/object/select_holder.hpp,v
retrieving revision 1.19
diff -u -r1.19 select_holder.hpp
--- select_holder.hpp 25 Aug 2003 18:41:02 -0000 1.19
+++ select_holder.hpp 18 Jul 2004 14:30:23 -0000
@@ -94,7 +94,7 @@
private:
typedef mpl::or_<
mpl::not_<is_same<T,Held> >
- , has_back_reference<T>
+ , mpl::bool_<has_back_reference<T>::value>
> use_back_ref;
public:
@@ -123,7 +123,7 @@
typedef typename python::pointee<Ptr>::type wrapper;
typedef mpl::or_<
mpl::not_<is_same<T,wrapper> >
- , has_back_reference<T>
+ , mpl::bool_<has_back_reference<T>::value>
> use_back_ref;
public:
More information about the Cplusplus-sig
mailing list