Azure / azure-storage-cpp

Microsoft Azure Storage Client Library for C++
http://azure.github.io/azure-storage-cpp
Apache License 2.0
131 stars 147 forks source link

Does not support C++ 2017? #356

Open sindhuvahinis opened 4 years ago

sindhuvahinis commented 4 years ago

Why this library does not support C++ 2017 standard?

Jinming-Hu commented 4 years ago

Because we want to keep compatible with VS2015 compilers and old GCC versions that are still widely used, such as GCC 5.

amensel commented 4 years ago

That's an admirable goal. It should not, however, mean the library should be incompatible with newer compilers and standards; just because you don't use the features doesn't mean the build should fail.

Right now, it does. util.cpp uses C++17-removed code. It's a very simple fix, however, since you appear to require C++11 (and therefore have lambdas)

    utility::string_t str_trim_starting_trailing_whitespaces(const utility::string_t& str)
    {
        auto non_space_begin = std::find_if(str.begin(), str.end(), [](char c) { return !std::isspace(c); });
        auto non_space_end = std::find_if(str.rbegin(), str.rend(), [](char c) { return !std::isspace(c); }).base();
        return utility::string_t(non_space_begin, non_space_end);
    }

And then as consumers, we can at least include your project in our builds.

Jinming-Hu commented 4 years ago

@amensel Thanks for pointing this out. Do you want to create a PR so that you can get the credit?

amensel commented 4 years ago

Sure.

Do you guys have any specific contributor requirements, or do I just fork and open a PR?

EDIT: PR opened. Let me know if you need anything else.