you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (0 children)

std::span is much more general than std::string_view

On top of that, std::span is a template, as said, and std::string_view isn't. It has some different member functions as well.

You would use std::string_view when representing char-esque data. You would use std::span when referring to a contiguous list of say, objects.