Code review comment for lp:~pete-woods/unity-api/add-glib-assigner-class

Revision history for this message
Michi Henning (michihenning) wrote :

I'm in two minds about this.

auto o = unique_glib(g_foobar(args..., GErrorAssigner(error)));

I don't like the need to explicitly use the GErrorAssigner here. With an implicit conversion to GError**, this would not be necessary.

I'm also not that keen on the macro hackery. I know, it's not your fault… :-)

How about having a class instead that is specific to GError and provides the implicit conversion?
That way, I can write

AutoGerror error;
auto o = g_foobar(args..., error);

Call the class AutoGError maybe? Or maybe GErrorGuard would be a better name?

Something along these lines:

http://pastebin.ubuntu.com/24219982

I think this would be easier to use and also easier to understand in terms of how it is implemented?

review: Needs Information

« Back to merge proposal