mercredi 6 décembre 2017

Is it possible to create own pointer qualification in C++03/11?

I would like to append extra user-defined qualifications to pointer like

mymem const void *A;     // Compiled
mymem const void *B = A; // Compiler
const void *C = A;       // Not compiled

C++ allow to have cv-qualificaions and real compiler allow some extension on it (like restrict). But is it possible to create own qualifers and distinguish between them?

Via some C++ class/object mechanism or via C preprocessor.

Aucun commentaire:

Enregistrer un commentaire