Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Benchmarking is tricky and unreliable (depends on too many factors), especially for such small examples. A better metric is to simply check the generated assembly and look at the instruction count. You can use Compiler Explorer for that. Here's a comparison using your solution: https://godbolt.org/z/EY3EK753r. Passing by reference generates 7 additional instructions in this case.
Passing a basic type (such as int, char, bool, float etc) by reference can actually be less efficient than passing it by value. Remember that a reference is just a pointer and it's address still needs to be copied to the function (and since the address is an int, it's exactly as costly as passing by value). And then there's also the overhead of dereferencing that pointer (basically the * operator, which the language is hiding from us when we use references, but it's still there). So all in all, it's not worth it!
Passing a basic type (such as int, char, bool, float etc) by reference can actually be less efficient than passing it by value. Remember that a reference is just a pointer and it's address still needs to be copied to the function (and since the address is an int, it's exactly as costly as passing by value). And then there's also the overhead of dereferencing that pointer (basically the * operator, which the language is hiding from us when we use references, but it's still there). So all in all, it's not worth it!
Since you know the final size of the vector (lines.size()), you should really try to reserve the space beforehand (with the #reserve method). Otherwise you will get a lot of unnecessary allocations and copying with those "push_back" methods when the vector grows.
The inline here is redundant, because constexpr implies inline :)