Ticket #4621 (closed Patches: fixed)

Opened 5 years ago

Last modified 5 years ago

Feature Request: add some version of "type erasure" range/iterator

Reported by: Ilya Murav'jov <muravev@…> Owned by: neilgroves
Milestone: To Be Determined Component: range
Version: Boost 1.44.0 Severity: Not Applicable
Keywords: Cc: muravev@…



I successfully use B.Lambda/B.Function for closure functionality in my code and would like to do the same with complex iterators/ranges . I've successfully implemented such "any" iterator range on top of any_iterator ( thanks to ), see  any_range.h . The common use case is as follows (my real code,  select.cpp):

  fe::range<Comp::MediaObj*> SelectedMediaObjs(MenuRegion& mn_rgn, const int_array& sel_arr)
      return fe::make_any( sel_arr | fe::transformed(ToMOTransform(mn_rgn)) );
  fe::range<Comp::MediaObj*> SelectedMediaObjs(MEditorArea& edt_area)
      return SelectedMediaObjs(edt_area.CurMenuRegion(), edt_area.SelArr());

  // somewhere else
  BOOST_FOREACH( Comp::MediaObj* obj, SelectedMediaObjs(edt_area) )
      res_mi = obj->MediaItem();


any_range.h Download (1.6 KB) - added by Ilya Murav'jov <muravev@…> 5 years ago.

Change History

Changed 5 years ago by Ilya Murav'jov <muravev@…>

comment:1 Changed 5 years ago by neilgroves

  • Status changed from new to closed
  • Resolution set to fixed

Implementation added to the trunk.


Add a comment

Modify Ticket

Change Properties
<Author field>
as closed
The resolution will be deleted. Next status will be 'reopened'

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.