[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[glob2-devel] Just a thing about libgag and const char *
From: |
Stéphane Magnenat |
Subject: |
[glob2-devel] Just a thing about libgag and const char * |
Date: |
Mon, 13 Mar 2006 22:33:11 +0100 |
User-agent: |
KMail/1.9.1 |
Please note that there is some fair and good use of const char * in libgag.
Indeed, when a function will always or most of the time take a string
constant from the caller, then const char * is optimal.
Example:
void writeUInt32(UInt32, const char *name),
as this code will always be called like this:
writeUInte32(toto, "toto");
When the string argument is not supposed to be constant, then a std:.string is
better, for instance in :
Text::setText(const std::string &s)
which will typicall be called as
someWidget->setText(someOtherWidget->getText() + "...");
In some case, both behaviour can take place and function overloading can be
the solution.
If someone want to do some change in libgag, please ask me so we can discuss
it and no libgag convention war will take place.
Thanks,
Steph
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [glob2-devel] Just a thing about libgag and const char *,
Stéphane Magnenat <=