Re: GThread struct now hidden
- From: Kjell Ahlstedt <kjell ahlstedt bredband net>
- To: Murray Cumming <murrayc murrayc com>
- Cc: gtkmm-list <gtkmm-list gnome org>
- Subject: Re: GThread struct now hidden
- Date: Thu, 24 Nov 2011 10:01:00 +0100
2011-11-23 13:51, Murray Cumming skrev:
Unfortunately, glibmm now does not build with --enable-warnings=fatal:
template<class T> inline
Private<T>::Private(typename Private<T>::DestructorFunc destructor_func)
{
//TODO: This causes this warning:
//extended initializer lists only available with -std=c++0x or -std=gnu
++0x
//See glib bug: https://bugzilla.gnome.org/show_bug.cgi?id=664618
//We can work around this by building like so:
//./configure --prefix=/opt/gnome30 'CXXFLAGS=-std=c++0x'
gobject_ = G_PRIVATE_INIT(destructor_func);
}
#define G_PRIVATE_INIT(notify) { NULL, (notify), { NULL, NULL } }
can be used for initialization, but it can't be used for assignment.
This version builds:
template <class T> inline
Private<T>::Private(typename Private<T>::DestructorFunc destructor_func)
{
GPrivate temp = G_PRIVATE_INIT(destructor_func);
gobject_ = temp;
}
I similar trick is used in glib/glib/deprecated/gthread-deprecated.c,
function g_private_new().
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]