[glibmm/glibmm-2-50] Glib::Variant—Explain how to create “maybe” types
- From: Daniel Boles <dboles src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glibmm/glibmm-2-50] Glib::Variant—Explain how to create “maybe” types
- Date: Mon, 13 Feb 2017 15:47:59 +0000 (UTC)
commit 5a3d8dac838abb4acd084be1eeb2f82e706edb19
Author: Daniel Boles <dboles src gnome org>
Date: Mon Feb 6 00:00:57 2017 +0000
Glib::Variant—Explain how to create “maybe” types
It’s not exactly intuitive why the *_maybe() methods are kept in
ContainerBase, nor that Variant<VariantBase> inherits from the former
and is the way to get a maybe-typed Variant in glibmm. Let’s fix that!
https://bugzilla.gnome.org/show_bug.cgi?id=778219
glib/src/variant.hg | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/glib/src/variant.hg b/glib/src/variant.hg
index 6758c89..be0f4a7 100644
--- a/glib/src/variant.hg
+++ b/glib/src/variant.hg
@@ -340,8 +340,8 @@ public:
_WRAP_METHOD(static bool is_signature(const std::string& string), g_variant_is_signature)
};
-/** The base class from which multiple-item Variants derive, such as Variants
- * containing tuples or arrays.
+/** The base class for multiple-item Variants, such as Variants containing
+ * tuples or arrays, and also for maybe-typed (i.e. nullable) Variant types.
*
* @newin{2,28}
* @ingroup Variant
@@ -448,6 +448,9 @@ public:
/****************** Specializations ***********************************/
/** Specialization of Variant containing a VariantBase.
+ * Perhaps the main use of this is as a maybe-typed (i.e. nullable) Variant, as
+ * it inherits methods create_maybe() and get_maybe() from VariantContainerBase.
+ *
* @newin{2,28}
* @ingroup Variant
*/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]