lundi 24 octobre 2016

What does gcc's std::vector

According to the standard, std::vector<bool> has no member function data(). However, the following snippet compiles fine with the latest gcc:

#include <vector>

int main () {
    std::vector<bool> v;
    v.data();
}

If we try to use the result, it turns out the return type is void.

Is this some gcc extension or a bug?
If the former is true, what does it do?

Aucun commentaire:

Enregistrer un commentaire