<p>I agree with that change; otherwise the call to <code>arma::Mat<eT>::col()</code> has to cast the result (which is a <code>subview_col</code>) into an <code>arma::Col<eT></code>, which means calling the constructor. It's a little bit of extra overhead that can be avoided by using the solution you just proposed. Usually I will call <code>T</code> <code>VecType</code> instead, and sometimes (although I doubt it's necessary here), you can enforce the type by using SFINAE with the <code>IsVector</code> class... something like this:</p>
<pre><code>// This can only be called with an arma::Col<eT>.
template<typename VecType>
void Function(VecType& a, typename boost::enable_if<IsVector<VecType>>*);
</code></pre>
<p>But I don't know if SFINAE is necessary here. If you want, you can find <code>IsVector</code> in <code>src/mlpack/core/util/arma_traits.hpp</code>.</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/mlpack/mlpack/pull/664#issuecomment-223390450">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe/AJ4bFGTqCX32RsTRx6WLxe7FoQLyn52yks5qHylfgaJpZM4IrlzT">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFMwEypLulFnA38IMMB_3O47ny5KBks5qHylfgaJpZM4IrlzT.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
<link itemprop="url" href="https://github.com/mlpack/mlpack/pull/664#issuecomment-223390450"></link>
<meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>