Re: Replacing old C-style casts with static|reinterpret_cast?
- From: Kjell Ahlstedt <kjellahlstedt gmail com>
 
- To: Daniel Boles <dboles src gmail com>
 
- Cc: gtkmm-list <gtkmm-list gnome org>
 
- Subject: Re: Replacing old C-style casts with static|reinterpret_cast?
 
- Date: Sat, 20 May 2017 11:51:30 +0200
 
Den 2017-05-19 kl. 17:04, skrev Daniel Boles:
Murray and Kjell: Any thoughts on the prospect of replacing C style 
casts with reinterpret_cast where appropriate? Chiefly, when 
converting between opaque (and thus not static_castable, and also 
probably breaking aliasing rules...) pointers to GObjects at different 
levels of the inheritance hierarchy.
I did prepare a patch doing this for master, which I think covered all 
or most instances, and compiled - and can't foresee any possible 
issues - but obviously discussion is needed (and my foresight is not 
exactly renowned).
If this works, then it would be another nice C++ification to see 
throughout the codebase.
Cheers!
Daniel
reinterpret_cast is already used for conversion between different levels 
of the GObject inheritance hierarchy, e.g. in the gobj() methods 
generated by _CLASS_GOBJECT, _CLASS_INTERFACE and _CLASS_GTKOBJECT. But 
it's not used consistently in other situations. I see no harm in using 
it consistently.
Kjell
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]