[C++-sig] mapping object pointers with boost

Monty Taylor monty at inaugust.com
Wed Oct 11 02:05:52 CEST 2006


Once again, that did the trick. The copy_const_ref was me trying to do
the opposite of the right thing.

One more question... (probably more of just a basic C++ question -
it's a little rusty)

The code has a nested class Dictionary inside NdbDictionary. The
Dictionary class has a method, getTable. So I tried this:

class_<NdbDictionary::Dictionary,boost::noncopyable>("Dictionary",no_init)
    .def("getTable", &NdbDictionary::Dictionary::getTable,
	 return_value_policy<reference_existing_object>() )
    ;

But it doesn't see getTable as a method - it sees NdbDictionary as a
method that it can't find. How do I tell it how to find the original
method?

Thanks!
Monty

On 10/10/06, Alex Mohr <amohr at pixar.com> wrote:
> >   class_<NdbDictionary>("NdbDictionary",no_init);
> >
> > Problem is, Dictionary's constructor and destructor are protected,
> > which boost doesn't seem to like.
>
> Try:
>
> class_<NbdDictionary, boost::noncopyable>(...)
>
> But if the copy ctor's protected/private, I don't think copy_const_ref
> can work.
>
> Alex
> _______________________________________________
> C++-sig mailing list
> C++-sig at python.org
> http://mail.python.org/mailman/listinfo/c++-sig
>



More information about the Cplusplus-sig mailing list