mercredi 4 janvier 2017

Getting raw array from std::array

What's the canonical way to get an std::array's underlying raw (C) array?

The data() method returns just a raw pointer, which makes it unsuitable e.g. for passing into functions which accept a reference to a raw array of a known size.

Also, is there a good reason why data() returns a raw pointer, and not a reference to the underlying raw array, or is this just an oversight?

Aucun commentaire:

Enregistrer un commentaire