On Tue, 01 Sep 2009 at 19:36:24 +0100, Will Thompson wrote: > Andre Moreira Magalhaes wrote: > > So changing it won't make much difference from what we have now. We > > would have a class with the constructor containing all the default > > values. Why let in the constructor? As they can't be changed after creation.
No, the point of the FTProps object is to emulate Python keyword arguments.
I believe this is called "the named parameters idiom" in C++, if you replace
this:
> FTProps p("cat.jpg", "image/jpeg", 5000);
>
> p.lastModificationTime(47547);
> cr = account.createFileTransfer("[email protected]", p)
>
> // and never use 'p' again.
with something like this:
account.createFileTransfer("[email protected]", "cat.jpg", "image/jpeg", 5000,
FTProps()
.lastModificationTime(47547)
.description("my cat")
.hash("crc32", "deadbeef"));
This also allows adding more properties later, if needed (as long as the
FTProps struct has a mPriv).
S
signature.asc
Description: Digital signature
_______________________________________________ telepathy mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/telepathy
