Passing two parameters: one by const ref. and another by ref.

Is it okay to pass two parameters to a function with one by constant referecne and the other by reference?

  void getUniqueIP(const vector<string>& refIP, vector<string>& refUniqueIP)

Prefer 'reference to const T' over 'constant reference to T'.

Consider rewriting the function as:

std::vector<std::string> getUniqueIP( const std::vector<std::string>& refIP ) ;

Last edited on
Topic archived. No new replies allowed.