mercredi 28 septembre 2016

std::ignore for ignoring unused variable

It is good approach to use std::ignore for ignoring unused variables.

So suppose I have a function like this -

  void func(int i)
    {
       //for some reason, I don't need i anymore but I cannot change signature of function

    std::ignore = i;

    }

Aucun commentaire:

Enregistrer un commentaire