Printable View
or does it cause undefined behavior?
it is perfectly acceptable. You can always add const-ness