[cfe-commits] [PATCH 11/15] Fix Casting
Dmitri Gribenko
gribozavr at gmail.com
Fri Jan 11 10:31:07 PST 2013
On Fri, Jan 11, 2013 at 8:29 PM, Argyrios Kyrtzidis <akyrtzi at gmail.com> wrote:
> On Jan 11, 2013, at 9:59 AM, Dmitri Gribenko <gribozavr at gmail.com> wrote:
>
>> On Thu, Jan 10, 2013 at 9:12 PM, David Greene <dag at cray.com> wrote:
>>> Use const_cast<> to avoid a cast-away-const error.
>>
>> Maybe a helper function template would be better (for all except the
>> first)? Argyrios?
>
> How about just adding a function accepting a Decl* and a CXCursorKind, and have the others delegate to that.
Maybe a const Decl* (or the casts will remain in the calls)? My point
is that const_casts don't add to type safety here.
Dmitri
--
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/
More information about the cfe-commits
mailing list