Boost C++ Libraries: Ticket #9204: const_multi_array_ref with const https://svn.boost.org/trac10/ticket/9204 <p> It's now declared as </p> <div class="wiki-code"><div class="code"><pre><span class="k">template</span> <span class="o">&lt;</span><span class="k">typename</span> <span class="n">T</span><span class="p">,</span> <span class="n">std</span><span class="o">::</span><span class="kt">size_t</span> <span class="n">NumDims</span><span class="p">,</span> <span class="k">typename</span> <span class="n">TPtr</span> <span class="o">=</span> <span class="k">const</span> <span class="n">T</span><span class="o">*</span> <span class="o">&gt;</span> </pre></div></div><p> This makes it SFINAE-fail if you use const type for T, like <code>const_multi_array_ref&lt;const double, 2&gt;</code>. </p> <p> This simple change fixes the problem (tested): </p> <div class="wiki-code"><div class="code"><pre><span class="cp">#include</span> <span class="cpf">&quot;boost/type_traits/add_const.hpp&quot;</span><span class="cp"></span> <span class="p">...</span> <span class="k">template</span> <span class="o">&lt;</span><span class="k">typename</span> <span class="n">T</span><span class="p">,</span> <span class="n">std</span><span class="o">::</span><span class="kt">size_t</span> <span class="n">NumDims</span><span class="p">,</span> <span class="k">typename</span> <span class="n">TPtr</span> <span class="o">=</span> <span class="k">typename</span> <span class="n">boost</span><span class="o">::</span><span class="n">add_const</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;::</span><span class="n">type</span> <span class="o">*</span> <span class="o">&gt;</span> </pre></div></div> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/9204 Trac 1.4.3