[C++-sig] Calling python from c++ with tuple and dict args.
Alex Mohr
amohr at pixar.com
Tue Mar 7 20:55:00 CET 2006
> [Nat] I find myself wondering what *dict should produce -- an error?
It's a good question. I think it should be an error, but I'm not sure
how it should manifest itself. *dict needs to produce a valid object
(so we can invoke * on it), but that object will have an API that will
likely not really work anywhere other than where it is meant to, and we
can provide overloads for the places where we expect it might
accidentally be used. For instance:
bp::object::operator()(unpacked_tuple const &,
/* result of *dict */ intermediate_unpacked_dict const &) {
// compile-time-error
}
Incidentally, the same general idea is true about unpacked_tuple and
unpacked_dict -- we need to try to make sure that they only make sense
in only the case of the specific operator() on object.
Alex
More information about the Cplusplus-sig
mailing list