3 ms·
Would someone point me to a C implementaion of folly/FBString ? Or any C String OSS lib that is similar to what C++ std::string(/wiew) does ? More precisely, o
by alcover 5y ago
Would someone point me to a C implementaion of folly/FBString ? Or any C String OSS lib that is similar to what C++ std::string(/wiew) does ?
More precisely, one that defines a datatype (no SDS-like trick) and has all goodies like SSO, CoW, views, thread-safety, etc..
I'm making such a lib but can't seem to find other examples to compare.
- guavaNinja 5y agoThis[1] is a c-flavoured c++ STL replacement, uses minimal number of c++ features to be easy to use yet simple. We built it and use it internally where I work. It's not c but almost c, it could be useful for you [1] https://github.com/MoustaphaSaad/mn/blob/master/mn/include/mn/Str.h https://github.com/MoustaphaSaad/mn/blob/master/mn/include/m...
- alcover 5y agoThank you. You don't seem to provide a c_str() equivalent (a method that gives a pointer to or copies out a C-string) or views ? Sorry if I missed them.
- guavaNinja 5y agoWe hate getters/setters. There is `using Str = Buf<char>` if you looked into Buf you will find ptr and count and cap. You are looking for ptr
- synergy20 5y agoThis is still all in c++ correct? why not just using STL instead, am I missing something here. There are a few pure-C made STL alike containers for C that uses no c++ code at all, a random github search finds this: https://github.com/assyrianic/Harbol https://github.com/assyrianic/Harbol , there are quite a few of them just not recalling them now.