Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 5th, 2012  |  syntax: None  |  size: 0.36 KB  |  hits: 7  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. long long my_vector::operator [] (int i) const
  2. {
  3.    if (length > 1)
  4.       return digits[i];
  5.    else
  6.       return digit;
  7. }
  8. long long& my_vector::operator [] (int i)
  9. {
  10.    const my_vector &a = *this;
  11.    return const_cast<long long &>(a[i]); //на эту строчку выдаёт «для "&" требуется левостороннее значение»
  12. }