Re: [eigen] API change proposal |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] API change proposal
- From: Tim Hutt <tdhutt@xxxxxxxxx>
- Date: Thu, 23 Jul 2009 15:39:39 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=t+FLTA4YPfn8qCHHpRDDy4d3aBMFhE4P74jyid6MdIo=; b=ZYCk1ERLliuOUJsTp0xmB4O9XpbiOt/k/slgvA2GBSJk5QUo+Eh+B6wboTVvUOZ2V2 5yg78FYD4sZIECj67d7UOaMdEw0C3ZSQFbtbcD/Qi+YgSIKZX9UIKL6vgBRMiJfhk0jE KZToAREjjsCzw9jyS9aGqLLQRjyLNozvhXQAQ=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=TiL7acsO+K7FH1UmZLBwxA1XWyY+Ix7Fg9oXvdX/0q8M1ExwUoQ5RijoYIc4W7LLrE ErZD1KLc+Y2T+BnbPHzjcsY7Dg1BQBr3try2RUYLNvSj1r/kpGDrLiCfM64v26yoHgmv GXnIwWVeM75vfpHBmd+X71Vgo4nOtCyl81OT4=
2009/7/23 Kenneth Riddile <kfriddile@xxxxxxxxx>:
> I'll chime in here...When I see a function that takes any type of pointer
> (const/non-const) as a parameter, this signals to me that null is a valid
> value to pass to the function. If null is not a valid value, then the
> argument should be passed by reference. As far as whether or not it's
> obvious from the call site whether the argument may be modified, one has to
> assume that a user/maintainer will look at the signature of the function
> when trying to understand its purpose. A function's signature is its public
> interface after all.
I concur. The only place pointers should be used is where the value
might be NULL. However this doesn't include cases like this:
int atoi(int x, bool* error = NULL);
In that case I think it would be better to have to have two functions:
int atoi(int x);
int atoi(int x, bool& error);