I try to sort a vector of tuple but I have a strange error:
typedef std::tuple<const std::string, const std::string, const unsigned int> nodesfound;
std::vector<nodesfound> nf;
fil_vector(nf);
std::sort(nf.begin(), nf.end(), [](nodesfound const &n1, nodesfound const &n2) {
return std::get<2>(n1) < std::get<2>(n2);
});
the error is:
/usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/tuple:299:17: error: no viable overloaded '='_M_head(*this) = std::forward<_Head>(_M_head(__in));
if I remove the sort line my program is perfectly fine