← Back to context Comment by groundzeros2015 11 hours ago In C you have char* 7 comments groundzeros2015 Reply rcxdude 10 hours ago Which isn't very good for substrings due to the null-termination requirement. groundzeros2015 12 minutes ago Struct Substring { char start, end };My point is ownership being transferred implicitly in a struct assignment is a complexity introduced by C++.In C the concern of allocating memory and using it is separate.String_view is attempt to add more separation. But C programmers were already there. kccqzy 11 hours ago And the type system does not tell you if you need to call free on this char* when you’re done with it. groundzeros2015 25 minutes ago Correct. Haphazardly passing ownership of individual nodes around is a C++ and OOP anti-pattern. pjc50 11 hours ago In C you only have char*. groundzeros2015 13 minutes ago You can compose char* in a struct. tosti 6 hours ago wchar exists.(And the possibility to implement whatever you want, ofc.)
rcxdude 10 hours ago Which isn't very good for substrings due to the null-termination requirement. groundzeros2015 12 minutes ago Struct Substring { char start, end };My point is ownership being transferred implicitly in a struct assignment is a complexity introduced by C++.In C the concern of allocating memory and using it is separate.String_view is attempt to add more separation. But C programmers were already there.
groundzeros2015 12 minutes ago Struct Substring { char start, end };My point is ownership being transferred implicitly in a struct assignment is a complexity introduced by C++.In C the concern of allocating memory and using it is separate.String_view is attempt to add more separation. But C programmers were already there.
kccqzy 11 hours ago And the type system does not tell you if you need to call free on this char* when you’re done with it. groundzeros2015 25 minutes ago Correct. Haphazardly passing ownership of individual nodes around is a C++ and OOP anti-pattern.
groundzeros2015 25 minutes ago Correct. Haphazardly passing ownership of individual nodes around is a C++ and OOP anti-pattern.
pjc50 11 hours ago In C you only have char*. groundzeros2015 13 minutes ago You can compose char* in a struct. tosti 6 hours ago wchar exists.(And the possibility to implement whatever you want, ofc.)
Which isn't very good for substrings due to the null-termination requirement.
Struct Substring { char start, end };
My point is ownership being transferred implicitly in a struct assignment is a complexity introduced by C++.
In C the concern of allocating memory and using it is separate.
String_view is attempt to add more separation. But C programmers were already there.
And the type system does not tell you if you need to call free on this char* when you’re done with it.
Correct. Haphazardly passing ownership of individual nodes around is a C++ and OOP anti-pattern.
In C you only have char*.
You can compose char* in a struct.
wchar exists.
(And the possibility to implement whatever you want, ofc.)