Skip to content

Commit 71ea2be

Browse files
committed
more notes
[SVN r16330]
1 parent c9af6ca commit 71ea2be

1 file changed

Lines changed: 30 additions & 1 deletion

File tree

doc/polymorphism.txt

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,39 @@ Open questions:
179179
Deduce target type of pvmf, i.e. T in R(T::*)(A1...AN).
180180
Find holder in first argument which holds T
181181
if it holds dispatch_type...
182-
182+
183183
2. Can we make this more efficient?
184184

185185
The current "returning" mechanism will look up a holder for T
186186
again. I don't know if we know how to avoid that.
187187

188188

189+
OK, the solution involves reworking the call mechanism. This is
190+
neccesary anyway in order to enable wrapping of function objects.
191+
192+
It can result in a reduction in the overall amount of source code,
193+
because returning<> won't need to be specialized for every
194+
combination of function and member function... though it will still
195+
need a void specialization. We will still need a way to dispatch to
196+
member functions through a regular function interface. mem_fn is
197+
almost the right tool, but it only goes up to 8
198+
arguments. Forwarding is tricky if you don't want to incur copies.
199+
I think the trick is to use arg_from_python<T>::result_type for each
200+
argument to the forwarder.
201+
202+
Another option would be to use separate function, function object,
203+
and member function dispatchers. Once you know you have a member
204+
function, you don't need cv-qualified overloads to call it.
205+
206+
Hmm, while we're at this, maybe we should solve the write-back
207+
converter problem. Can we do it? Maybe not. Ralf doesn't want to
208+
write special write-back functions here, does he? He wants the
209+
converter to do the work automatically. We could add
210+
cleanup/destructor registration. That would relieve the client from
211+
having accessible destructors for types which are being converted by
212+
rvalue. I'm not sure that this will really save any code,
213+
however. It rather depends on the linker, doesn't it? I wonder if
214+
this can be done in a backwards-compatible fashion by generating the
215+
delete function when it's not supplied?
216+
217+

0 commit comments

Comments
 (0)