N
n.torrey.pines
I'd like to be able to view two contiguous elements of a vector as a
pair.
Assuming I'm not accessing the last element, of course, and the
element type is not bool, when is it safe to do so, from the language
definition point of view?
const pr& p = *(const pr*)(&v);
// pr - either std:air or hand-defined pair of elements
// v - vector instance
// i + 1 < v.size()
pair.
Assuming I'm not accessing the last element, of course, and the
element type is not bool, when is it safe to do so, from the language
definition point of view?
const pr& p = *(const pr*)(&v);
// pr - either std:air or hand-defined pair of elements
// v - vector instance
// i + 1 < v.size()