Accessing operator inside struct itself

Viewed 153

I'm trying to access an operator inside the struct itself, is this possible?

struct st{
    float vd;
    float val(){
      return this[3]; //this dont work, is there a some way?
    }
    float operator[](size_t idx){
        return  vd*idx;
    }
};
1 Answers
Related