RE: Iterating through all nodes and attributes of a wxXmlDocument

Kenneth Porter <[email protected]>
Newsgroups gmane.comp.lib.wxwindows.general
Message-ID <[email protected]>
Small correction. The auto in the ranged for loops should use a 
"forwarding reference" (double ampersands). This was added in C++11.
> for (auto&& child : node->GetChildrenAsRange()) 
> doSomethingWithNode(child);
>
> for (auto&& attr : node->GetAttributesAsRange()) 
> doSomethingWithAttribute(attr); 

The forwarding reference, a feature of template parameters and auto, 
allow it to copy the const and volatile attributes of the argument.

https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4164.pdf

-- 
Please read https://www.wxwidgets.org/support/mlhowto.htm before posting.
--- 
You received this message because you are subscribed to the Google Groups "wx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/wx-users/e423a96c-94d2-481f-87ce-091b34b81376%40sewingwitch.com.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.