I am working on making a 'safetype' abstract class, which will have a complete set of pure virtual operator overloads to help make sure that a class inherited from it is safe to pass to virtual any function. The problem is that I don't know the syntax of a pure virtual operator overload or if any of the operators are unable to be virtualized. Can somebody give me an example of how to write a pure virtual operator, as well as list any operators that cannot be made purely virtual?

7 Years
Discussion Span
Last Post by Labdabeta

Actually there is little to no reason to make operators virtual, with mild exception to operator=;

As for the syntax you can do this :

struct F{
 virtual F& operator+(const F& f)const = 0;
 //.. and so on

Edited by firstPerson: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.