[Clam-devel] TypedControls Patch

Pau Arumí parumi at iua.upf.edu
Sun May 11 03:13:14 PDT 2008


On ds, 2008-05-10 at 13:29 -0300, Francisco Tufró wrote:
> If you pass them by reference you can't do a SendControl(1) because
> that is passed by copy.
> So, i got confused with your mail.
> Read:
> > out.SendControl(1); won't work because the signature wants reference
> > to a non-constant var! And we need it to work, for backwards
> > compatibility among other reasons.

Yes, and keep reading :-)

> > So change the test passing a constant, and pass the test by changing
> > SendControl and DoControl arguments to be const references.
        
> So, i think what pau meant is that the class is passed by copy.
> If you pass it by reference you can't do a SendControl(1).
> So please talk with each other and tell me what to do :(

No, we both are saying the same.
Ok, i guess the confusion lies in "passing tokens by copy (opposed to
passing a reference)" vs "passing method arguments by copy". We want the
first but not the second. that is, we want to do a copy of the sent
token but only one copy, at the receiving point.

To make it crystal clear see this patch. This keeps the tests green.
(the patch has been commited).
Makes sense now?

Pau

-------------- next part --------------
A non-text attachment was scrubbed...
Name: typed_controls_by_copy.patch
Type: text/x-patch
Size: 3035 bytes
Desc: not available
URL: <http://lists.clam-project.org/pipermail/clam-devel-clam-project.org/attachments/20080511/95a0173e/attachment-0004.bin>


More information about the clam-devel mailing list