I am using Visual C++ 2013.
I need to redefine my delete keyword (yet another memory management tool)
#define delete foo(SOME,PARA,METERS), delete
The purpose is to redirect delete to an overridden version of mine, but I have an issue when using the "= delete" keyword or using external code using it.
Class Something {
public:
Something() {}
Something(const Something &) = delete;
}
Note : VC13 gives the following errors :
error C2061: syntax error : identifier 'instance'
error C2238: unexpected token(s) preceding ';'
Question
Is there a way to redefine delete without affecting =delete ?
Notes (edition)
Redefining a keyword is indeed something to handle with care and could probably be avoided by another design in practically any case. I am already fully aware of that and I do not ask for a workaround. See this question more as a research than an actual production development.
This being said I just want to discuss here the issue that we have a keyword having two different meanings in two different situations.
So the question is simply about defining delete when used as a release operation and not as a "no implementation" mark.