vendredi 3 mai 2019

C++ Processor Macro Create Keywords

I want to be able to construct the 'delete' keyword with the preprocessor. My idea is to do

#define _helper(first, second) first ## second
#define makedelete _helper(del, ete)

Which should concat 'del' and 'ete' into 'delete' and then not attempt to expand 'delete' with any preprocessor macros. But when i try and do

Class A {
    A() = makedelete
}

I get the error "badly-formed pure specifier (only '=0' is allowed)"

This may not be possible at all but it feels like I am close.

Aucun commentaire:

Enregistrer un commentaire