mercredi 2 mars 2016

Determine at compile time if this is read only

Is it possible to determine if this pointer is a const pointer at compile time? I would like to achieve something like this:

class Foo
{
    Foo() 
    { 
        static_assert( is this read only?, "works only on read only objects"); 
    }
}

Is something like that possible?

Aucun commentaire:

Enregistrer un commentaire