lundi 17 avril 2017

Why doesn't std::remove_const remove const qualifier?

Note that I use std::thread just to get readable types in the errors:

int main() {
            const int * first;
            using deref = decltype(*first);
            std::thread s = std::remove_const<deref>::type{}; // const int ???
            std::thread s2 = deref{}; // const int
            std::thread s3 = std::remove_const<const int>::type{}; // int 

}

It seems as if remove_const<deref>::type is const int, not mutable int as I would expect.

Aucun commentaire:

Enregistrer un commentaire