[RFC] unifying gfc_symbol and gfc_component
Thomas Koenig
tkoenig@netcologne.de
Tue Nov 15 10:32:00 GMT 2016
> In general, I'm not proposing that we should use as many C++ features
> as possible, but I'm sure there are multiple opportunities for
> improvement if we selectively use some C++ in places where it makes
> sense.
I have to confess I am a bit divided on this.
I have used C++ features in some of my patches: Optional arguments
(which are really handy if you need to extend a function, and
need that _one_ piece of extra information) and vectors, mostly
for push and pop. This was actually clearer than the horrible
macro-based containers which were available in gcc before.
And yes, I can understand what std::swap means (which is
actually clearer than the C idiom).
I am much less certain that a retrofit of data structures based
on inheritance is going to make things better. If gfortran would
have been built as a C++ application from the start, yes, but
that didn't happen at the time. Retrofitting such a structure
may well lead to less clarity, not more.
> I certainly don't want to scare off voluntary maintainers and
> contributors, but rather make things easier for them. IMHO everyone
> who is fluent enough in C and Fortran to contribute to gfortran will
> also be able to deal with some C++ (and I'm not talking about advanced
> stuff like template metaprogramming here, but just basics).
Well, my C++ foo is somewhere in between non-existent and weak,
so I would prefer if the features used were really, really
kept to a minimum.
Regards
Thomas
More information about the Fortran
mailing list