lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 899a163 3/9: Improve documentation


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 899a163 3/9: Improve documentation
Date: Thu, 12 Jul 2018 13:12:57 -0400 (EDT)

branch: master
commit 899a16378e217a8e3825451f77d002ce821c703c
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Improve documentation
---
 single_cell_document.cpp | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/single_cell_document.cpp b/single_cell_document.cpp
index 03ac44c..b34d426 100644
--- a/single_cell_document.cpp
+++ b/single_cell_document.cpp
@@ -116,7 +116,13 @@ void single_cell_document::parse(xml_lmi::dom_parser 
const& parser)
     xml::const_nodes_view const elements(root.elements());
     // An '.ill' document's root contains only one child element.
     LMI_ASSERT(1 == elements.size());
-    // "*elements.begin()" because there is no front():
+    // "*elements.begin()" because there is no front(). A 2017-01-26
+    // discussion off the mailing list explained why:
+    // 'The nodes returned by nodes_view::iterator are actually
+    //  temporary objects as the only "real" nodes we have are
+    //  xmlNodes in the tree maintained by libxml2 itself. So
+    //  returning "*begin()" from front() actually results in a
+    //  dangling reference'.
     *elements.begin() >> input_data_;
 }
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]