Boost C++ Libraries: Ticket #5547: boost::range::join ambiguous with boost::algorithm::join https://svn.boost.org/trac10/ticket/5547 <h1 class="section" id="Summary">Summary</h1> <p> Calling boost::join with an iterator range when both boost algorithm and boost range join.jpp headers have been included, introduces an ambiguity with Visual Studio 2010. </p> <h1 class="section" id="StepstoReproduce">Steps to Reproduce</h1> <pre class="wiki">#include &lt;vector&gt; #include &lt;boost/algorithm/string/join.hpp&gt; #include &lt;boost/range/join.hpp&gt; int main() { std::vector&lt; int &gt; vec1; std::vector&lt; int &gt; vec2; boost::join( vec1, boost::make_iterator_range( vec2.begin(), vec2.end() ) ); return 0; } </pre><h1 class="section" id="ExpectedResults">Expected Results</h1> <p> Code to compile and do nothing. </p> <h1 class="section" id="ActualResults">Actual Results</h1> <p> <code>main.cpp(16): error C2668: 'boost::range::join' : ambiguous call to overloaded function</code> </p> <p> <code>boost\range\join.hpp(65): could be 'boost::range::join</code> </p> <p> <code>boost\algorithm\string\join.hpp(46): or 'boost::algorithm::join'</code> </p> <h1 class="section" id="Notes">Notes</h1> <p> boost::algorithm::join is pulled into the boost namespace with a using declaration. boost::join is defined directly in the boost namespace by the range library meaning I can't explicitly refer to it. </p> <p> Current workaround is to move boost::join into boost::range::join, and then pull it into the boost namespace with a using declaration. </p> <pre class="wiki">namespace range { join(SinglePassRange1&amp; r1, SinglePassRange2&amp; r2); } // namespace range using range::join; </pre><p> Allowing the example code to be resolved by being more explicit: </p> <pre class="wiki">boost::range::join( vec1, boost::make_iterator_range( vec2.begin(), vec2.end() ) ); </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/5547 Trac 1.4.3 anonymous Wed, 18 May 2011 00:10:44 GMT component changed; owner set https://svn.boost.org/trac10/ticket/5547#comment:1 https://svn.boost.org/trac10/ticket/5547#comment:1 <ul> <li><strong>owner</strong> set to <span class="trac-author">Neil Groves</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">range</span> </li> </ul> <p> forgot to set component to boost range </p> Ticket Neil Groves Sun, 22 May 2011 21:20:30 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/5547#comment:2 https://svn.boost.org/trac10/ticket/5547#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> Thank you for your report. This is now resolved on the trunk. </p> Ticket