operator ! for Encoder.

So... I am supposed to write a function where the operator "!" will reset the values of the encoder with the statement "!MyEncoder;" for a object "MyEncoder",

I want to know an example of how to create an operator that could be applied in the above using c++ (Linux). Thanks for the help.
It's straight forward:
1
2
3
4
5
6
7
8
9
10
11
12
13
class CMyEncoder
{
public:
  void operator!()
  {
    reset();
  }
};
...
  CMyEncoder MyEncoder;
...
  !MyEncoder;
...
Thank you!
Topic archived. No new replies allowed.