[glibmm] Glib::Variant—Explain how to create “maybe” types



commit 1272f39711a21594c9a513bc4bbdca808b14d4ed
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 07fcfa4..280f3b3 100644
--- a/glib/src/variant.hg
+++ b/glib/src/variant.hg
@@ -316,8 +316,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
@@ -424,6 +424,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]