You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
zstring family require empty template parameter list for use #992
Based on the cpp core guidelines I expect to be able to write code like this int length(zstring p);
but with this gsl implementation the code must look like this (at least on my compiler) int length(zstring<> p);
I infer from the unit tests that this problem is not specific to me or my compiler. See for example:
Not sure if this is a problem with the core guidelines or the gsl implementation but based on #770 it seems like the type alias shouldn't be templated.
zstring<> is only marginally worse than zstring but the time wasted figuring out why the example code wouldn't compile in practice is my primary concern.
I ran a quick search on Github for zstring and czstring to see how users are using *zstring and found that the majority of uses just have empty angle brackets. I came across a couple uses where the user does specify an extent, here is one such case: https://github.com/luncliff/coroutine/search?q=zstring. Most of the other hits that I found were clones or copies of this coroutine library.
Activity
JordanMaples commentedon Aug 18, 2021
I've reached out the C++ Core Guidelines editors for comment on whether or not we should redefine zstring to remove the empty angle brackets.
hsutter commentedon Sep 30, 2021
Echoing this question from the Guidelines issue: Do we have data about whether the extra parameter is used in the field?
SloppyJaconda commentedon Sep 30, 2021
I ran a quick search on Github for
zstringandczstringto see how users are using *zstring and found that the majority of uses just have empty angle brackets. I came across a couple uses where the user does specify an extent, here is one such case:https://github.com/luncliff/coroutine/search?q=zstring. Most of the other hits that I found were clones or copies of this coroutine library.
SloppyJaconda commentedon Sep 30, 2021
whoops, didn't mean to close.
dmitrykobets-msft commentedon Jan 10, 2022
This issue has now been resolved in PR #998