The Artima Developer Community
Sponsored Link

Weblogs Forum
Introducing the Iterable Concept

16 replies on 2 pages. Most recent reply: Nov 13, 2005 9:01 PM by Christopher Diggins

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 16 replies on 2 pages [ « | 1 2 ]
MB 2sync

Posts: 3
Nickname: mb2sync
Registered: Nov, 2005

Iterable is alive Posted: Nov 10, 2005 9:48 PM
Reply to this message Reply
Win32 has an API ::EnumChildWindows.
It is a model of "Iterable".

::EnumChildWindows should have been defined as
"Single Pass Range", but Win32 didn't know the concept and
cannot even stop the iteration.
So we cannot write a wrapper Range for ::EnumChildWindows
without additional resources like std::set<HWND>.

I always defined "for_each_toplevel_window" or something using ::EnumChildWindows.
If using "Iterable", it could be


or, (C++ style)

for_each(toplevel_windows, functor);

On the other hand, an API ::FindFirstFile can conform to "Single Pass Range",
because it returns a handle as "iterator".

I think that "Iterable" has less abstraction, but has more "power" than
Container or Range, because "Iterable" can iterate over a range that is difficult to
represent by two iterators.


Christopher Diggins

Posts: 1215
Nickname: cdiggins
Registered: Feb, 2004

Re: Introducing the Iterable Concept Posted: Nov 13, 2005 9:01 PM
Reply to this message Reply
In response to the suggestions by Terje, I have created a downloadable demo of the Iterator concept with library support at . I now also have some documentation at .

There is a new blog entry for the latest release at which summarizes the documentation, and provides some code snippets.

Flat View: This topic has 16 replies on 2 pages [ « | 1  2 ]
Topic: No way to run a judicial system... Previous Topic   Next Topic Topic: Trees and Labelled S-Expressions

Sponsored Links


Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use