Jump to content

  • Log In with Google      Sign In   
  • Create Account

#ActualParadigm Shifter

Posted 21 June 2013 - 09:57 AM

Stops you doing this

void CountDownFrom(int i)
{
    while(i > 0)
    {
        cout << i-- << endl;
    }
}

forcing you to copy the argument. Whether that is a good idea or not, I'll leave you to decide.

 

EDIT: OP should spend more time making member functions const-correct rather than concentrating solely on function arguments IMHO.


#2Paradigm Shifter

Posted 21 June 2013 - 09:54 AM

Stops you doing this

void CountDownFrom(int i)
{
    while(i > 0)
    {
        cout << i-- << endl;
    }
}

forcing you to copy the argument. Whether that is a good idea or not, I'll leave you to decide.


#1Paradigm Shifter

Posted 21 June 2013 - 09:53 AM

Stops you doing this

void CountDownFrom(int i)
{
    while(i > 0)
    {
        cout << i-- << endl;
    }
}

forcing you to copy the variable. Whether that is a good idea or not, I'll leave you to decide.


PARTNERS