fixed_string icon indicating copy to clipboard operation
fixed_string copied to clipboard

Support for C++11

Open eyalroz opened this issue 4 years ago • 5 comments

It would be nice if you could make this class C++11-compatible. Many of us are stuck using older versions of the language standard...

Obviously, this will mean some constexpr members may need to become CONSTEXPR_SINCE_CPP14 or CONSTEXPR_SINCE_CPP17; and you may need to drop std::array which is pre-constexpr'ed in C++11. But it's still worth it IMHO :-) ... a bit of preprocessor magic can make it happen.

eyalroz avatar Jun 18 '21 21:06 eyalroz

It's so nice to see that someone is interested in the library! The main reason I chose C++17 as the base standard was if constexpr because I didn't want to write all the std::enable_if boilerplate. Though now it seems it can be replaced with a simple if in the older standards with some kind of a macro or even removed. And, well, the main purpose of the library is to pass strings as class non-types template parameters (which reminds me that I should update the FIXSTR_CPP20_CNTTP_PRESENT macro.. and the README.md) I will consider adding support for the older standards, though I wouldn't mind external help :) Thank you for the feedback!

unterumarmung avatar Jul 01 '21 19:07 unterumarmung

Well, I noticed a pitfall I didn't see yesterday, the internal implementation of most member functions depends on the std::string_view. I don't think that implementing them all by myself is a good idea, neither I don't want to add dependencies on other libraries that implement a string_view. So, @eyalroz, I don't know about lowering C++ support for the library is even possible.

unterumarmung avatar Jul 02 '21 21:07 unterumarmung

@DBJDBJ well, code quality isn't great.. commit messages aren't either.. The intent of the library isn't clear and definitely differs from this one

unterumarmung avatar Aug 16 '21 20:08 unterumarmung

Well, I should have said what I have written at the top of the readme a minute ago.

Before I might commit some more time I would like to know what are the requirements @eyalroz has?

How should "fixed string" behave?

DBJDBJ avatar Aug 16 '21 21:08 DBJDBJ