operator []= method

void operator []=(
  1. int addr,
  2. double value
)

Implementation

void operator []=(int addr, double value){
  if(addr == 0){
    x = value;
  }
  else if(addr == 1){
    y = value;
  }
  else if(addr == 2){
    z = value;
  }
  else{
    throw('Value can not be bigger than 2 nd less than 0');
  }
}