Re: [Cluttermm] Use of Glib::RefPtr<T> vs. Gtkmm



2010/3/15 Murray Cumming <murrayc murrayc com>:
>> But we have to struggle in Clutter with that mess:
>> Glib::RefPtr<Clutter::Actor> actor = new Clutter::Actor::create();
>
> I don't like it much either, really.
>
> I like that the use of the smartpointer makes the memory management
> obvious. I would like to make such lines shorter somehow, while still
> keeping them clear. It's something to explore for gtkmm 3.

If you don't like writing the long return types, it's better to use
type inference in GCC 4.4. You need to pass -std=c++0x to enable C++0x
mode. Then it becomes:

auto actor = Clutter::Actor::create();

You can use this without any changes on the library side. It works at
least with glibmm and giomm.

Regards, Krzysztof


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]