Boost C++ Libraries: Ticket #1974: ambiguous call to ref in vector_of_vector.hpp when using bind.hpp https://svn.boost.org/trac10/ticket/1974 <p> When bind.hpp and numeric/ublas/vector_of_vector.hpp are both included, instantiating and using a generalized_vector_of_vector causes an ambiguous call to the overloaded function 'boost::numeric::ublas::ref'. See attached code for a simple example and attached patch for the simple proposed fix. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/1974 Trac 1.4.3 Will Moss <wmoss@…> Fri, 30 May 2008 14:13:20 GMT attachment set https://svn.boost.org/trac10/ticket/1974 https://svn.boost.org/trac10/ticket/1974 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">vector_of_vector.patch</span> </li> </ul> Ticket Will Moss <wmoss@…> Fri, 30 May 2008 14:14:13 GMT attachment set https://svn.boost.org/trac10/ticket/1974 https://svn.boost.org/trac10/ticket/1974 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">ublas_bug.cpp</span> </li> </ul> Ticket Gunter Wed, 18 Jun 2008 19:34:10 GMT <link>https://svn.boost.org/trac10/ticket/1974#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1974#comment:1</guid> <description> <p> Sorry, I cannot confirm this using g++ 4.1.2. Which compiler did you use? </p> <p> Actually the correct ref() function should be found by Koenig-lookup. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Gunter</dc:creator> <pubDate>Thu, 28 Aug 2008 21:55:56 GMT</pubDate> <title>status, milestone changed; resolution set https://svn.boost.org/trac10/ticket/1974#comment:2 https://svn.boost.org/trac10/ticket/1974#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">worksforme</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">Boost 1.36.0</span> → <span class="trac-field-new">To Be Determined</span> </li> </ul> <p> I close this issue because I did not get any comment on this and I cannot recreate it. </p> Ticket sspa9999@… Sat, 12 Oct 2013 22:50:01 GMT attachment set https://svn.boost.org/trac10/ticket/1974 https://svn.boost.org/trac10/ticket/1974 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">gvov.log</span> </li> </ul> <p> compiler error log </p> Ticket anonymous Sat, 12 Oct 2013 23:17:34 GMT <link>https://svn.boost.org/trac10/ticket/1974#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1974#comment:3</guid> <description> <p> Hi there, </p> <p> I can reproduce the error with Visual C++ 2012. Attached gvov.log is the VC++ error log for compiling the previously attached ublas_bug.cpp. The issue exists even without bind.hpp in ublas_bug.cpp. Note the same code actually compiles successfully with Visual C++ 2008, or recent g++. </p> <p> Thanks, Steven </p> </description> <category>Ticket</category> </item> <item> <author>sspa9999@…</author> <pubDate>Sat, 12 Oct 2013 23:19:22 GMT</pubDate> <title>status, version changed; resolution deleted https://svn.boost.org/trac10/ticket/1974#comment:4 https://svn.boost.org/trac10/ticket/1974#comment:4 <ul> <li><strong>status</strong> <span class="trac-field-old">closed</span> → <span class="trac-field-new">reopened</span> </li> <li><strong>version</strong> <span class="trac-field-old">Boost Development Trunk</span> → <span class="trac-field-new">Boost 1.54.0</span> </li> <li><strong>resolution</strong> <span class="trac-field-deleted">worksforme</span> </li> </ul> Ticket anonymous Thu, 05 Jun 2014 09:19:37 GMT <link>https://svn.boost.org/trac10/ticket/1974#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1974#comment:5</guid> <description> <p> I have this problem both on Windows with MSVC 2013 and on Mac with the default clang. Since the fix is trivial, I don't see why it shouldn't be implemented. </p> </description> <category>Ticket</category> </item> <item> <author>harrysummerxr@…</author> <pubDate>Mon, 22 Sep 2014 07:37:58 GMT</pubDate> <title>version changed https://svn.boost.org/trac10/ticket/1974#comment:6 https://svn.boost.org/trac10/ticket/1974#comment:6 <ul> <li><strong>version</strong> <span class="trac-field-old">Boost 1.54.0</span> → <span class="trac-field-new">Boost 1.56.0</span> </li> </ul> <p> I'm using Boost 1.56 + MSVC2013. I also this problem, even without including bind.hpp. The patch vector_of_vector.patch works like a charm. Here is my test code: </p> <div class="wiki-code"><div class="code"><pre><span class="cp">#include</span> <span class="cpf">&quot;boost/numeric/ublas/matrix.hpp&quot;</span><span class="cp"></span> <span class="cp">#include</span> <span class="cpf">&quot;boost/numeric/ublas/matrix_sparse.hpp&quot;</span><span class="cp"></span> <span class="cp">#include</span> <span class="cpf">&quot;boost/numeric/ublas/vector_of_vector.hpp&quot;</span><span class="cp"></span> <span class="kt">int</span> <span class="nf">main</span><span class="p">(</span><span class="kt">int</span> <span class="n">argc</span><span class="p">,</span> <span class="kt">char</span><span class="o">**</span> <span class="n">argv</span><span class="p">)</span> <span class="p">{</span> <span class="n">boost</span><span class="o">::</span><span class="n">numeric</span><span class="o">::</span><span class="n">ublas</span><span class="o">::</span><span class="n">generalized_vector_of_vector</span><span class="o">&lt;</span><span class="kt">double</span><span class="p">,</span> <span class="n">boost</span><span class="o">::</span><span class="n">numeric</span><span class="o">::</span><span class="n">ublas</span><span class="o">::</span><span class="n">row_major</span><span class="p">,</span> <span class="n">boost</span><span class="o">::</span><span class="n">numeric</span><span class="o">::</span><span class="n">ublas</span><span class="o">::</span><span class="n">vector</span><span class="o">&lt;</span><span class="n">boost</span><span class="o">::</span><span class="n">numeric</span><span class="o">::</span><span class="n">ublas</span><span class="o">::</span><span class="n">compressed_vector</span><span class="o">&lt;</span><span class="kt">double</span><span class="o">&gt;</span> <span class="o">&gt;</span> <span class="o">&gt;</span> <span class="n">gvov</span><span class="p">(</span><span class="mi">10</span><span class="p">,</span> <span class="mi">10</span><span class="p">);</span> <span class="n">gvov</span><span class="p">.</span><span class="n">clear</span><span class="p">();</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span> <span class="p">}</span> </pre></div></div><p> My first compile error: </p> <pre class="wiki">C:\Boost\include\boost-1_56\boost/numeric/ublas/vector_of_vector.hpp(326) : error C2668: 'boost::numeric::ublas::ref' : ambiguous call to overloaded function C:\Boost\include\boost-1_56\boost/numeric/ublas/vector_sparse.hpp(178): could be 'boost::numeric::ublas::compressed_vector&lt;double,0x00,boost::numeric::ublas::unbounded_array&lt;size_t,std::allocator&lt;T&gt;&gt;,boost::numeric::ublas::unbounded_array&lt;double,std::allocator&lt;double&gt;&gt;&gt; &amp;boost::numeric::ublas::ref&lt;boost::numeric::ublas::compressed_vector&lt;double,0x00,boost::numeric::ublas::unbounded_array&lt;T,std::allocator&lt;T&gt;&gt;,boost::numeric::ublas::unbounded_array&lt;double,std::allocator&lt;double&gt;&gt;&gt;&gt;(const VER &amp;)' with [ T=size_t , VER=boost::numeric::ublas::compressed_vector&lt;double,0x00,boost::numeric::ublas::unbounded_array&lt;size_t,std::allocator&lt;size_t&gt;&gt;,boost::numeric::ublas::unbounded_array&lt;double,std::allocator&lt;double&gt;&gt;&gt; ] C:\Boost\include\boost-1_56\boost/numeric/ublas/vector_sparse.hpp(174): or 'boost::numeric::ublas::compressed_vector&lt;double,0x00,boost::numeric::ublas::unbounded_array&lt;size_t,std::allocator&lt;T&gt;&gt;,boost::numeric::ublas::unbounded_array&lt;double,std::allocator&lt;double&gt;&gt;&gt; &amp;boost::numeric::ublas::ref&lt;boost::numeric::ublas::compressed_vector&lt;double,0x00,boost::numeric::ublas::unbounded_array&lt;T,std::allocator&lt;T&gt;&gt;,boost::numeric::ublas::unbounded_array&lt;double,std::allocator&lt;double&gt;&gt;&gt;&gt;(VER &amp;)' with [ T=size_t , VER=boost::numeric::ublas::compressed_vector&lt;double,0x00,boost::numeric::ublas::unbounded_array&lt;size_t,std::allocator&lt;size_t&gt;&gt;,boost::numeric::ublas::unbounded_array&lt;double,std::allocator&lt;double&gt;&gt;&gt; ] C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\xrefwrap(697): or 'void std::ref&lt;T&gt;(const _Ty &amp;&amp;)' [found using argument-dependent lookup] with [ T=boost::numeric::ublas::compressed_vector&lt;double,0x00,boost::numeric::ublas::unbounded_array&lt;size_t,std::allocator&lt;size_t&gt;&gt;,boost::numeric::ublas::unbounded_array&lt;double,std::allocator&lt;double&gt;&gt;&gt; , _Ty=boost::numeric::ublas::compressed_vector&lt;double,0x00,boost::numeric::ublas::unbounded_array&lt;size_t,std::allocator&lt;size_t&gt;&gt;,boost::numeric::ublas::unbounded_array&lt;double,std::allocator&lt;double&gt;&gt;&gt; ] C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\xrefwrap(691): or 'std::reference_wrapper&lt;T&gt; std::ref&lt;T&gt;(_Ty &amp;) throw()' [found using argument-dependent lookup] with [ T=boost::numeric::ublas::compressed_vector&lt;double,0x00,boost::numeric::ublas::unbounded_array&lt;size_t,std::allocator&lt;size_t&gt;&gt;,boost::numeric::ublas::unbounded_array&lt;double,std::allocator&lt;double&gt;&gt;&gt; , _Ty=boost::numeric::ublas::compressed_vector&lt;double,0x00,boost::numeric::ublas::unbounded_array&lt;size_t,std::allocator&lt;size_t&gt;&gt;,boost::numeric::ublas::unbounded_array&lt;double,std::allocator&lt;double&gt;&gt;&gt; ] while trying to match the argument list '(boost::numeric::ublas::compressed_vector&lt;double,0x00,boost::numeric::ublas::unbounded_array&lt;size_t,std::allocator&lt;T&gt;&gt;,boost::numeric::ublas::unbounded_array&lt;double,std::allocator&lt;double&gt;&gt;&gt;)' with [ T=size_t ] C:\Boost\include\boost-1_56\boost/numeric/ublas/vector_of_vector.hpp(322) : while compiling class template member function 'void boost::numeric::ublas::generalized_vector_of_vector&lt;double,boost::numeric::ublas::row_major,boost::numeric::ublas::vector&lt;boost::numeric::ublas::compressed_vector&lt;double,0x00,boost::numeric::ublas::unbounded_array&lt;size_t,std::allocator&lt;T&gt;&gt;,boost::numeric::ublas::unbounded_array&lt;double,std::allocator&lt;double&gt;&gt;&gt;,boost::numeric::ublas::unbounded_array&lt;boost::numeric::ublas::compressed_vector&lt;double,0x00,boost::numeric::ublas::unbounded_array&lt;T,std::allocator&lt;T&gt;&gt;,boost::numeric::ublas::unbounded_array&lt;double,std::allocator&lt;double&gt;&gt;&gt;,std::allocator&lt;boost::numeric::ublas::compressed_vector&lt;double,0x00,boost::numeric::ublas::unbounded_array&lt;T,std::allocator&lt;T&gt;&gt;,boost::numeric::ublas::unbounded_array&lt;double,std::allocator&lt;double&gt;&gt;&gt;&gt;&gt;&gt;&gt;::clear(void)' with [ T=size_t ] D:\test\main.cpp(10) : see reference to function template instantiation 'void boost::numeric::ublas::generalized_vector_of_vector&lt;double,boost::numeric::ublas::row_major,boost::numeric::ublas::vector&lt;boost::numeric::ublas::compressed_vector&lt;double,0x00,boost::numeric::ublas::unbounded_array&lt;size_t,std::allocator&lt;T&gt;&gt;,boost::numeric::ublas::unbounded_array&lt;double,std::allocator&lt;double&gt;&gt;&gt;,boost::numeric::ublas::unbounded_array&lt;boost::numeric::ublas::compressed_vector&lt;double,0x00,boost::numeric::ublas::unbounded_array&lt;T,std::allocator&lt;T&gt;&gt;,boost::numeric::ublas::unbounded_array&lt;double,std::allocator&lt;double&gt;&gt;&gt;,std::allocator&lt;boost::numeric::ublas::compressed_vector&lt;double,0x00,boost::numeric::ublas::unbounded_array&lt;T,std::allocator&lt;T&gt;&gt;,boost::numeric::ublas::unbounded_array&lt;double,std::allocator&lt;double&gt;&gt;&gt;&gt;&gt;&gt;&gt;::clear(void)' being compiled with [ T=size_t ] D:\test\main.cpp(9) : see reference to class template instantiation 'boost::numeric::ublas::generalized_vector_of_vector&lt;double,boost::numeric::ublas::row_major,boost::numeric::ublas::vector&lt;boost::numeric::ublas::compressed_vector&lt;double,0x00,boost::numeric::ublas::unbounded_array&lt;size_t,std::allocator&lt;T&gt;&gt;,boost::numeric::ublas::unbounded_array&lt;double,std::allocator&lt;double&gt;&gt;&gt;,boost::numeric::ublas::unbounded_array&lt;boost::numeric::ublas::compressed_vector&lt;double,0x00,boost::numeric::ublas::unbounded_array&lt;T,std::allocator&lt;T&gt;&gt;,boost::numeric::ublas::unbounded_array&lt;double,std::allocator&lt;double&gt;&gt;&gt;,std::allocator&lt;boost::numeric::ublas::compressed_vector&lt;double,0x00,boost::numeric::ublas::unbounded_array&lt;T,std::allocator&lt;T&gt;&gt;,boost::numeric::ublas::unbounded_array&lt;double,std::allocator&lt;double&gt;&gt;&gt;&gt;&gt;&gt;&gt;' being compiled with [ T=size_t ] </pre> Ticket pa@… Mon, 14 Dec 2015 17:50:23 GMT <link>https://svn.boost.org/trac10/ticket/1974#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1974#comment:7</guid> <description> <p> Just a heads up: The bug is also present in 1.59 compiled with </p> <pre class="wiki">$ gcc -v Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version 7.0.2 (clang-700.1.81) Target: x86_64-apple-darwin15.2.0 Thread model: posix </pre><p> (the default "gcc" in MacOS X El Capitain). </p> <p> The conflict here is again with a system library </p> <pre class="wiki">/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/__functional_base_03:1115:1: note: candidate function [with _Tp = boost::numeric::ublas::mapped_vector&lt;double, boost::numeric::ublas::map_std&lt;unsigned long, double, std::__1::allocator&lt;std::__1::pair&lt;const unsigned long, double&gt; &gt; &gt; &gt;] ref(_Tp&amp; __t) </pre><p> The simple 8 year old patch applies flawlessly, and solves the problem. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Fri, 23 Dec 2016 01:06:46 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/1974#comment:8 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1974#comment:8</guid> <description> <p> Please implement this simple fix for this annoying problem. The same thing is flagged by g++ versions 4.8.5 and 5.3.0 on gnu/linux systems. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Sat, 17 Feb 2018 15:32:15 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/1974#comment:9 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1974#comment:9</guid> <description> <p> I can confirm that this bug exists on Windows using the latest ms compiler. I can also confirm that the provided patch DOES fix the issue. Any info on when this will be fixed? </p> </description> <category>Ticket</category> </item> </channel> </rss>