Skip to content

Mark swap as noexcept#106

Open
Flamefire wants to merge 1 commit into
boostorg:developfrom
Flamefire:noexcept-swap
Open

Mark swap as noexcept#106
Flamefire wants to merge 1 commit into
boostorg:developfrom
Flamefire:noexcept-swap

Conversation

@Flamefire

Copy link
Copy Markdown
Contributor

All used operations are trivial or already noexcept so set the annotation.
This is recommended for swap implementations

@nigels-com

Copy link
Copy Markdown

std::swap(std::vector) is noexcept for C++17. But it's less clear for C++11 and C++14.

As a workaround, perhaps conditional compilation using BOOST_CXX_VERSION which is probably OK considering it's a header-only library?

#if BOOST_CXX_VERSION >= 201703L
// C++17 or later
#endif

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants