Commit c756dfc7 authored by Davis King's avatar Davis King

Changed code slightly so that calling identity_matrix<double>(a_matrix) results

in a compile time error rather than a confusing runtime error.
parent 3495a79e
......@@ -1945,12 +1945,16 @@ namespace dlib
};
template <
typename T
typename T,
typename U
>
const matrix_diag_op<op_identity_matrix_2<T> > identity_matrix (
const long& size
const U& size
)
{
// the size argument must be some scalar value, not a matrix!
COMPILE_TIME_ASSERT(is_matrix<U>::value == false);
DLIB_ASSERT(size > 0,
"\tconst matrix_exp identity_matrix<T>(size)"
<< "\n\tsize must be bigger than 0"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment