id summary reporter owner description type status milestone component version severity resolution keywords cc 10127 coordinate_matrix sort() fails on to std::swap anonymous Gunter "Orginally posted here: http://stackoverflow.com/questions/24228772/c11-compatibility-of-sparse-matrix-implementations The following program does not compile with gcc 4.8 or clang 3.4 when --std=c++11 is set: {{{ #include #include using namespace boost::numeric::ublas; int main(int argc, char** argv) { coordinate_matrix m1(100, 100, 100); for (int i = 0; i < 100; i++) m1.insert_element(i,i,i); compressed_matrix m2(m1, 100); } }}} We can solve the issue by providing a swap() routine: {{{ #include #include using namespace boost::numeric::ublas; namespace std { template inline void swap (boost::numeric::ublas::index_triple i1, boost::numeric::ublas::index_triple i2) { i1.swap (i2); } } int main(int argc, char** argv) { coordinate_matrix m1(100, 100, 100); for (int i = 0; i < 100; i++) m1.insert_element(i,i,i); compressed_matrix m2(m1, 100); } }}} I am not an expert C++ template programmer, so I am unable to decide what is the cause here, but the C++ reference on std::sort explicitly mentions a swap() method." Bugs new Boost 1.58.0 uBLAS Boost 1.54.0 Showstopper c++11,swap,sort,matrix,reference