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?
Labdabeta
182
Posting Pro in Training
Featured Poster
Recommended Answers
Jump to PostActually 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 };
All 2 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.