samedi 3 février 2018

error: assignment of read-only location while parsing Inputs from CLI

I'm writing a test for a binding and got following error:

    error: assignment of read-only location ‘mlpack::CLI::GetParam<const int>((* & name))’
CLI::GetParam<typename std::remove_reference<T>::type>(name) =
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
     std::forward<T>(value);

I was trying to get the reference to the value of a parameter passed:

arma::mat& output = CLI::GetParam<arma::mat>("output");
arma::mat& centroid = CLI::GetParam<arma::mat>("centroid");

After passing some Input Params

SetInputParam("input_file", std::move(InputData));
SetInputParam("clusters",std::move(C));

Documentation of CLI and other MAcros

Aucun commentaire:

Enregistrer un commentaire