On Tue, 09 Feb 2010 08:29:56 Monty Taylor wrote:
> Ah - so this brings me to the next thing I was going to suggest, which
> is to move inline method bodies out of the class definition (also
> suggested in the Ellemtel standard [1]) If we do that, it also solves
> the "want to keep parameter name for documentation reason, but need to
> remove it because it's unused in the inline method body" problem. Like so:
>
> class Foo
> {
> public:
> explicit Foo(std::string &name_in);
> void doSomething(int x, int y);
> private:
> std::string name;
> };
>
> inline void Foo::doSomething(int x, int)
> {
> string new_name(name);
> for(int num= 0; num < x; ++num)
> {
> new_name.append(name);
> }
> name= new_name;
> }
>
> This way our classes start to be more readable as interfaces but we keep
> inline functions in the headers for the speed reasons.
>
> Thoughts?
I was thinking exactly the same thing.
Tim
_______________________________________________
Mailing list: https://launchpad.net/~drizzle-discuss
Post to : [email protected]
Unsubscribe : https://launchpad.net/~drizzle-discuss
More help : https://help.launchpad.net/ListHelp