Boost C++ Libraries: Ticket #1427: [iterator] transform_iterator should use boost::result_of to determine functor result type https://svn.boost.org/trac10/ticket/1427 <p> transform_iterator should use boost::result_of to determine result type of functor instead of nested result_type. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/1427 Trac 1.4.3 debionne@… Fri, 31 Jul 2009 08:53:33 GMT attachment set https://svn.boost.org/trac10/ticket/1427 https://svn.boost.org/trac10/ticket/1427 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">patch_transform_iterator</span> </li> </ul> <p> transform_iterator.hpp patch for boost 1.39 </p> Ticket debionne@… Fri, 31 Jul 2009 08:54:21 GMT attachment set https://svn.boost.org/trac10/ticket/1427 https://svn.boost.org/trac10/ticket/1427 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">patch_transform_iterator_test</span> </li> </ul> <p> transform_iterator_test.cpp patch for boost 1.39 </p> Ticket debionne@… Fri, 31 Jul 2009 09:03:59 GMT <link>https://svn.boost.org/trac10/ticket/1427#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1427#comment:1</guid> <description> <p> The patchs above changes the mechanism that computes the default result type of the given <a class="missing wiki">UnaryFunction</a> to use boost::result_of. Consequently, transform_iterator now support polymorphic object function (i.e. function wich result type depends on the arguments type). Such a function object must implement the result_of 'protocol', that is implement a nested result structure such as : </p> <p> template &lt;class FArgs&gt; struct result; template &lt;class F, class T&gt; struct result&lt;F(T)&gt; {typedef whatever&lt;T&gt;::type type}; </p> <p> A polymorphic object function is added to the tests. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Jeremiah Willcock</dc:creator> <pubDate>Wed, 09 Jun 2010 01:08:46 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/1427#comment:2 https://svn.boost.org/trac10/ticket/1427#comment:2 <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">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/62625" title="Applied patches from #1427; fixes #1427">[62625]</a>) Applied patches from <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/1427" title="#1427: Feature Requests: [iterator] transform_iterator should use boost::result_of to determine ... (closed: fixed)">#1427</a>; fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/1427" title="#1427: Feature Requests: [iterator] transform_iterator should use boost::result_of to determine ... (closed: fixed)">#1427</a> </p> Ticket mimomorin@… Sat, 11 Dec 2010 00:38:58 GMT status changed; resolution deleted https://svn.boost.org/trac10/ticket/1427#comment:3 https://svn.boost.org/trac10/ticket/1427#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">closed</span> → <span class="trac-field-new">reopened</span> </li> <li><strong>resolution</strong> <span class="trac-field-deleted">fixed</span> </li> </ul> <p> Reopened, until merged to release. </p> Ticket Marshall Clow Sat, 08 Jan 2011 18:38:47 GMT <link>https://svn.boost.org/trac10/ticket/1427#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1427#comment:4</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/67792" title="Merging fixes to release; fixes #2294 fixes #4918 fixes #3645 refs ...">[67792]</a>) Merging fixes to release; fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/2294" title="#2294: Bugs: Please improve test annotation (closed: fixed)">#2294</a> fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4918" title="#4918: Patches: concept_check.hpp triggers self-assignment warnings (closed: fixed)">#4918</a> fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/3645" title="#3645: Bugs: iterator_facade does not work in presence of ::implicit_cast (closed: fixed)">#3645</a> refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/2823" title="#2823: Bugs: [fusion] vector copy constructor copies sequence members in different ... (closed: fixed)">#2823</a> refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/1427" title="#1427: Feature Requests: [iterator] transform_iterator should use boost::result_of to determine ... (closed: fixed)">#1427</a> refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/2893" title="#2893: Library Submissions: Function Input Iterator (closed: fixed)">#2893</a> </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Marshall Clow</dc:creator> <pubDate>Sat, 08 Jan 2011 18:48:20 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/1427#comment:5 https://svn.boost.org/trac10/ticket/1427#comment:5 <ul> <li><strong>status</strong> <span class="trac-field-old">reopened</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> Ticket mimomorin@… Sun, 09 Jan 2011 05:51:38 GMT status changed; resolution deleted https://svn.boost.org/trac10/ticket/1427#comment:6 https://svn.boost.org/trac10/ticket/1427#comment:6 <ul> <li><strong>status</strong> <span class="trac-field-old">closed</span> → <span class="trac-field-new">reopened</span> </li> <li><strong>resolution</strong> <span class="trac-field-deleted">fixed</span> </li> </ul> <p> <a class="changeset" href="https://svn.boost.org/trac10/changeset/67792" title="Merging fixes to release; fixes #2294 fixes #4918 fixes #3645 refs ...">r67792</a> does not seem to do anything with transform_iterator.hpp. Is there something missing? </p> Ticket Marshall Clow Thu, 13 Jan 2011 01:25:14 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/1427#comment:7 https://svn.boost.org/trac10/ticket/1427#comment:7 <ul> <li><strong>status</strong> <span class="trac-field-old">reopened</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/68076" title="Merging fixes to release; Fixes #1427">[68076]</a>) Merging fixes to release; Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/1427" title="#1427: Feature Requests: [iterator] transform_iterator should use boost::result_of to determine ... (closed: fixed)">#1427</a> </p> Ticket mimomorin@… Mon, 17 Jan 2011 13:03:27 GMT status changed; resolution deleted https://svn.boost.org/trac10/ticket/1427#comment:8 https://svn.boost.org/trac10/ticket/1427#comment:8 <ul> <li><strong>status</strong> <span class="trac-field-old">closed</span> → <span class="trac-field-new">reopened</span> </li> <li><strong>resolution</strong> <span class="trac-field-deleted">fixed</span> </li> </ul> <p> I've experimented with the updated <code>transform_iterator</code>, and found a discrepancy between code and document. </p> <p> The document says that the (default) <code>reference</code> member of <code>transform_iterator</code> is </p> <pre class="wiki">result_of&lt;UnaryFunction(iterator_traits&lt;Iterator&gt;::reference)&gt;::type </pre><p> But the code uses </p> <pre class="wiki">result_of&lt;UnaryFunction(iterator_traits&lt;Iterator&gt;::value_type)&gt;::type </pre><p> We should modify the code to use <code>reference</code> instead of <code>value_type</code>, because </p> <ul><li>the discrepancy is confusing for users </li><li><code>reference</code> better interacts with the <code>result_of</code> protocol than <code>value_type</code> </li></ul><p> The current code in trunk/release causes compiler error in the following code: </p> <pre class="wiki">#include &lt;boost/array.hpp&gt; #include &lt;boost/iterator/transform_iterator.hpp&gt; #include &lt;boost/spirit/include/phoenix.hpp&gt; int main(int argc, char* argv[]) { boost::array&lt;int, 3&gt; ar = {{}}; *boost::make_transform_iterator(ar.cbegin(), boost::phoenix::arg_names::_1); return 0; } </pre><p> I will attach a patch for fixing this. </p> <p> Sorry for reopening this ticket repeatedly. </p> Ticket mimomorin@… Mon, 17 Jan 2011 13:10:36 GMT attachment set https://svn.boost.org/trac10/ticket/1427 https://svn.boost.org/trac10/ticket/1427 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">transform_iterator.patch</span> </li> </ul> <p> A patch against trunk (boost/iterator/transform_iterator.hpp) </p> Ticket mimomorin@… Mon, 17 Jan 2011 13:11:28 GMT attachment set https://svn.boost.org/trac10/ticket/1427 https://svn.boost.org/trac10/ticket/1427 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">transform_iterator_test.patch</span> </li> </ul> <p> A patch against trunk (libs/iterator/test/transform_iterator_test.cpp) </p> Ticket Marshall Clow Mon, 17 Jan 2011 14:53:48 GMT <link>https://svn.boost.org/trac10/ticket/1427#comment:9 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1427#comment:9</guid> <description> <p> I've committed these patches as <a class="changeset" href="https://svn.boost.org/trac10/changeset/68205" title="Added Michel's patches for #1427">[68205]</a> </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Daniel James</dc:creator> <pubDate>Fri, 28 Jan 2011 08:40:31 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/1427#comment:10 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1427#comment:10</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/68524" title="Revert [68076], refs #1427. Will try to fix this properly in 1.47. ">[68524]</a>) Revert <a class="changeset" href="https://svn.boost.org/trac10/changeset/68076" title="Merging fixes to release; Fixes #1427">[68076]</a>, refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/1427" title="#1427: Feature Requests: [iterator] transform_iterator should use boost::result_of to determine ... (closed: fixed)">#1427</a>. </p> <p> Will try to fix this properly in 1.47. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Daniel James</dc:creator> <pubDate>Tue, 29 Mar 2011 21:31:32 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/1427#comment:11 https://svn.boost.org/trac10/ticket/1427#comment:11 <ul> <li><strong>status</strong> <span class="trac-field-old">reopened</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/70715" title="Iterator: Use boost::result_of to determine nested result type of ...">[70715]</a>) Iterator: Use boost::result_of to determine nested result type of function in transform_iterator. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/1427" title="#1427: Feature Requests: [iterator] transform_iterator should use boost::result_of to determine ... (closed: fixed)">#1427</a>. </p> Ticket