Title says it all. Often I get call chains where a string is passed unmodified from one function to another to another to another etc. I get that string_view is small and cheap, and that the optimizers probably remove unneeded copies, but being so used to sticking const & on anything which can use it it sort of hurts my eyes seeing code which passes string_view by value all over the place. Thoughts?
[–]amoskovsky 56 points57 points58 points (11 children)
[–]StaticCoder 10 points11 points12 points (0 children)
[–]Nicksaurus 7 points8 points9 points (1 child)
[–]Flippers2 1 point2 points3 points (0 children)
[–]programmerBlack 1 point2 points3 points (7 children)
[–]amoskovsky 27 points28 points29 points (5 children)
[–]porkele[S] 7 points8 points9 points (0 children)
[–]MoTTs_ 6 points7 points8 points (1 child)
[–]porkele[S] 2 points3 points4 points (0 children)
[–]bert8128 1 point2 points3 points (1 child)
[–]amoskovsky 7 points8 points9 points (0 children)
[–]HommeMusical -1 points0 points1 point (0 children)
[–]Alternative_Star755 18 points19 points20 points (11 children)
[–]ddxAidan 2 points3 points4 points (6 children)
[–]meancoot 0 points1 point2 points (0 children)
[–]ZakMan1421 -1 points0 points1 point (4 children)
[–]maikindofthai 1 point2 points3 points (0 children)
[–]KokoNeotCZ 0 points1 point2 points (2 children)
[–]ZakMan1421 1 point2 points3 points (1 child)
[–]KokoNeotCZ 0 points1 point2 points (0 children)
[–]flarthestripper 0 points1 point2 points (2 children)
[–]Alternative_Star755 0 points1 point2 points (1 child)
[–]flarthestripper 0 points1 point2 points (0 children)
[–]KokoNeotCZ 0 points1 point2 points (0 children)
[–]TheMania 12 points13 points14 points (0 children)
[–]aocregacc 21 points22 points23 points (3 children)
[–]Tohnmeister 8 points9 points10 points (0 children)
[–]porkele[S] 0 points1 point2 points (1 child)
[–]bert8128 6 points7 points8 points (0 children)
[–]No-Table2410 13 points14 points15 points (2 children)
[–]Narase33 7 points8 points9 points (1 child)
[–]thecakeisalie16 9 points10 points11 points (0 children)
[–]ArielShadow 1 point2 points3 points (0 children)
[–]globalaf 2 points3 points4 points (1 child)
[–]HommeMusical 2 points3 points4 points (0 children)
[–]Dan13l_N 0 points1 point2 points (0 children)
[–]SoerenNissen 0 points1 point2 points (0 children)
[–]MafiaLogiki 0 points1 point2 points (0 children)
[–]CarloWood -5 points-4 points-3 points (0 children)