Skip to content

Use C++11 decltype where possible

Xavier Claessens requested to merge xclaesse/glib:typeof into master

There are various places glib uses __typeof__ for type safety, but that's a GNUC extension. C++11 has standard decltype() that does a similar job, at least for cases we care about.

This avoids C++ code to always have to cast return value of g_object_ref() which was causing type kind of error:

error: invalid conversion from ‘gpointer’ {aka ‘void*’} to ‘GstElementFactory*’ {aka ‘_GstElementFactory*’} [-fpermissive]

Edited by Philip Withnall

Merge request reports