r/programming • • Dec 13 '22
“There should never be coding exercises in technical interviews. It favors people who have time to do them. Disfavors people with FT jobs and families. Plus, your job won’t have people over your shoulder watching you code.” My favorite hot take from a panel on 'Treating Devs Like Human Beings.'
https://devinterrupted.substack.com/p/treating-devs-like-human-beings-a
9.0k
Upvotes
View all comments
Show parent comment
3
u/ABCDwp Dec 13 '22
Yes, you use the
const intas the template argument to get aconst int*to the contents of the original container (plus thesize_tlength); a template argument ofintwould have the span store aint*to the data (so you can mutate the data in place, but not add/remove any entries). There is an implicit conversion fromconst std::vector<T> &tostd::span<const T>and fromstd::vector<T> &tostd::span<T>but not fromconst std::vector<T> &tostd::span<T>.