1

In C++, there's 38 built-in operator. Here's the reference http://en.cppreference.com/w/cpp/language/operators

Now, I want to create new operator overloading (not in default operators). For example, I want to create custom operator @@. Can I do it in C++.

class X {
      public: 
           X() {} 
           X& operator@@(int b) { a += b*2; } 
      private: 
           int a;
}; 
X x; 
x = x @@ 2;

Thank you very much!

Ronaldinho
  • 125
  • 1
  • 9
  • 2
    Short answer, No, longer answer, see [C++ FAQ](http://isocpp.org/wiki/faq/operator-overloading#overload-operator) – jsantander Mar 11 '15 at 10:41

0 Answers0