You can’t make that code work as written since x
and y
are private.
If you make them public, this will work:
XY* operator ->()
{
return this;
}
More Related Contents:
- why this code is broken
- C++ crash on getting pointer [closed]
- How to use C++ in Go
- How do C++ class members get initialized if I don’t do it explicitly?
- Difference between string and char[] types in C++
- How to pass parameters correctly?
- Can we reassign the reference in C++?
- Is there a way to pass auto as an argument in C++?
- using \ in a string as literal instead of an escape
- Difference in performance between MSVC and GCC for highly optimized matrix multplication code
- Why can’t a derived class call protected member function in this code?
- How can I validate an integer input [duplicate]
- Why is the copy-constructor argument const?
- What causes runtime error message: std::system_error – operation not permitted, including mult-threading? [duplicate]
- Virtual destructor and undefined behavior
- Casting double array to a struct of doubles
- New to Xcode can’t open files in c++?
- C++ ifstream failbit and badbit
- Inverse fourier transformation in OpenCV
- Detecting simulated keyboard/mouse input
- Dependency injection with unique_ptr to mock
- Are pointer variables just integers with some operators or are they “symbolic”?
- Is there a standard date/time class in C++?
- Which type of sorting is used in the std::sort()?
- How to pass a 2d array through pointer in c [duplicate]
- Performance penalty for working with interfaces in C++?
- fatal error C1083: Cannot open include file: ‘xyz.h’: No such file or directory?
- Conditional compilation based on template values?
- convert string to integer in c++
- Reference invalidation after applying reverse_iterator on a custom made iterator