Consider the above code. PrintStructs will not copy structs at all but still guarantee the constness of MyStruct Constness is especially important. Consider the following awkward situation when you deal with vector of pointers.
Use Span to Avoid Vector of Pointers
Posted on