Boost C++ Libraries: Ticket #11188: can not use repeat(int)[] with std::ref and phoenix::ref https://svn.boost.org/trac10/ticket/11188 <p> Debian libboost-dev 1.55<br /> When trying to compile a rule containing: </p> <pre class="wiki">qi::repeat(std::ref(_n))[some_action] </pre><p> the compiler complains: /usr/include/boost/spirit/home/qi/directive/repeat.hpp:88:40: error: use of deleted function ‘std::reference_wrapper&lt;_Tp&gt;::reference_wrapper(_Tp&amp;&amp;) [with _Tp = int]’<br /> T start() const { return <strong>type(0);</strong> } </p> <p> In this situation qi:repeat (repeat.hpp:88:40) tries to create an iterator from<br /> std::reference_wrapper&lt;&gt;(rhs_value) which is not possible as a reference is needed! </p> <p> As a temporary workaround I used the following help type: </p> <pre class="wiki">template&lt;typename T&gt; class ref_rhs: public std::reference_wrapper&lt;T&gt; { private: T _rhval; public: using std::reference_wrapper&lt;T&gt;::reference_wrapper; // inherit constructors ref_rhs(T&amp;&amp; rhs): std::reference_wrapper&lt;T&gt;(_rhval), _rhval(rhs) {} }; </pre><p> and the call: qi::repeat(ref_rhs&lt;T&gt;(_n))[] works as expected. </p> <p> May be qi:repeat should iterate internally with integers rather than with iterators as the documentation says that in the call qi::repeat(_n) _n must be convertible to int anyway. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/11188 Trac 1.4.3 anonymous Tue, 14 Jun 2016 18:43:37 GMT version changed https://svn.boost.org/trac10/ticket/11188#comment:1 https://svn.boost.org/trac10/ticket/11188#comment:1 <ul> <li><strong>version</strong> <span class="trac-field-old">Boost 1.55.0</span> → <span class="trac-field-new">Boost 1.58.0</span> </li> </ul> Ticket