Boost C++ Libraries: Ticket #1756: Proposal to add make_view iterator range generator https://svn.boost.org/trac10/ticket/1756 <p> I propose to add a simple helper function to create an iterator range of boost::transform_iterators. This would effectively create a view over a different range or a container. </p> <p> Currently this is possible to do with considerable code duplication: </p> <blockquote> <p> make_iterator_range( </p> <blockquote> <p> make_transform_iterator(vec.begin(), fun), make_transform_iterator(vec.end(), fun)); </p> </blockquote> </blockquote> <p> Here "fun" could be a rather complex lambda or bind expression. What I propose is to wrap these calls into a simple generator make_view. The above code would look much better: </p> <blockquote> <p> make_view(vec.begin(), vec.end(), fun); </p> </blockquote> <p> or </p> <blockquote> <p> make_view(vec, fun); </p> </blockquote> <p> I've attached a sample implementation of the make_view function. </p> <p> PS: This straightforward implementation is quite sufficient for me and, IMHO, for most cases. However, one might want to optimize it by storing only one copy of the function object in the view or even deriving the view from it to make use of EBO. This imply that transform_iterator would have to be replaced with another equivalent that does not store the function object internally. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/1756 Trac 1.4.3 andysem@… Wed, 02 Apr 2008 15:23:25 GMT attachment set https://svn.boost.org/trac10/ticket/1756 https://svn.boost.org/trac10/ticket/1756 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">view.hpp</span> </li> </ul> <p> Sample implementation of the make_view function </p> Ticket Thorsten Ottosen Thu, 12 Jun 2008 10:03:25 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/1756#comment:1 https://svn.boost.org/trac10/ticket/1756#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">wontfix</span> </li> </ul> <p> Your code is quite fine, but this really belongs in the range_ex library which is up for review soon. </p> Ticket cheap Cialis buy Mon, 08 Jun 2009 11:22:37 GMT <link>https://svn.boost.org/trac10/ticket/1756#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1756#comment:2</guid> <description> <p> Snake: Huh? Oh, right. See you two a little bit laters-s-s. Ace: They'll be back. With pizza! <a class="ext-link" href="http://forum.ilmeteo.it/blog-MungoJerry"><span class="icon">​</span>erezione</a> <a class="ext-link" href="http://headachetreatment.net"><span class="icon">​</span>fioricet free prescription</a> <a class="ext-link" href="http://buycialis.cc/"><span class="icon">​</span>best price cialis</a> tjtoo9q <a class="ext-link" href="http://community.icontact.com/users/buy-tramadol"><span class="icon">​</span>tramadol org</a> </p> </description> <category>Ticket</category> </item> </channel> </rss>