Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support C++17 conformance #1007

Closed
SunnyWar opened this issue Oct 19, 2019 · 7 comments · Fixed by #1029
Closed

support C++17 conformance #1007

SunnyWar opened this issue Oct 19, 2019 · 7 comments · Fixed by #1029

Comments

@SunnyWar
Copy link

I added /std:c++17 option in so that I could make use of std::string_view. I got this error in Bond:

c:\dev\vcpkg\installed\x86-windows\include\bond\core\detail\visit_any.h(23): error C4996: 'std::result_of_t': warning STL4014: std::result_of and std::result_of_t are deprecated in C++17. They are superseded by std::invoke_result and std::invoke_result_t. You can define _SILENCE_CXX17_RESULT_OF_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to acknowledge that you have received this warning.

@chwarr
Copy link
Member

chwarr commented Oct 23, 2019

Yes, please feel free to start a PR to fix up issues like this. Since we need to continue supporting C++11, we'll probably want something like:

namespace bond
{
    namespace detail
    {
        #if THE_RIGHT_COMPILER_MACROS_TO_DETECT_17
            using invoke_result_of_t = std::invoke_result_t;
        #else
            using invoke_result_of_t = std::result_of_t;
        #endif
    }
}

@bhardwajs
Copy link
Contributor

@chwarr Do we need to keep supporting C++ 11? I would prefer not to. And, that way, I can also clean up the warnings related to _SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING.

@chwarr
Copy link
Member

chwarr commented Dec 11, 2019

Yes, we do still need to support C++11 for the foreseeable future. The current compiler minimum versions that we target support only C++11. The compiler minimum versions are:

  • Clang 3.8
  • G++ 5.4
  • MSVC 2013

We've been talking about dropping support for MSVC 2013 and moving to MSVC 2015. Even if we did that, we still couldn't move to C++14, as MSVC 2017 was the first version with C++14 support. Additionally, Clang 3.8 only goes up to C++14.

@SunnyWar
Copy link
Author

SunnyWar commented Apr 7, 2020

Yes, we do still need to support C++11 for the foreseeable future.

why?

@chwarr
Copy link
Member

chwarr commented Apr 7, 2020

Yes, we do still need to support C++11 for the foreseeable future.

why?

There are many, many users of Bond who are still using C++11 compilers. The products that Bond gets incorporated into usually will not take major compiler upgrades during their product life cycles. They'll only take library updates and minor compiler updates.

From the Bond project's perspective, we've found it easier to support older C++ standards in the same codebase, but only have one development line/branch rather than forking off a bunch of variants of Bond (e.g., at each version) that would need to be supported.

C++11 support can probably be dropped sometime in 2021, but this isn't a commitment.

@bhardwajs
Copy link
Contributor

Agree with @chwarr, it's better to have one codebase supporting older C++ standards. Library authors can deal with that complexity, but we shouldn't expose that to library users.

@SunnyWar - Please do see if you run into any issues with C++ 17 conformance. If you do, ping me and I will take a look.

My bigger goal is to see if we can have a build without boost. With C++ 17, I think we can do that. I will open a new issue for that.

@chwarr
Copy link
Member

chwarr commented Apr 10, 2020

See also #1005 Eliminate or reduce dependency on Boost for some background about the use of Boost.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants