Skip to content

Conversation

@matthijskooijman
Copy link
Contributor

In C++14, std::move was changed to be constexpr. Since the version
declared by ArxTypeTraits is (now) also constexpr, it should be declared
in the C++14 section. This means if the standard library supports only
C++11, the C++14 constexpr version is still available (must be
referenced as arx::arx_std::move in this case, since we can't replace
std::move).

In practice, newer gcc versions actually expose the constexpr versions
even when C++14 is not enabled, so it does not really matter there, but
this could help in older versions that do not support C++14 at all yet.

In C++14, std::move was changed to be constexpr. Since the version
declared by ArxTypeTraits is (now) also constexpr, it should be declared
in the C++14 section. This means if the standard library supports only
C++11, the C++14 constexpr version is still available (must be
referenced as arx::arx_std::move in this case, since we can't replace
`std::move`).

In practice, newer gcc versions actually expose the `constexpr` versions
even when C++14 is not enabled, so it does not really matter there, but
this could help in older versions that do not support C++14 at all yet.
@hideakitai hideakitai merged commit 491da4b into hideakitai:master Sep 30, 2020
hideakitai added a commit that referenced this pull request Sep 30, 2020
`move` must be declared before including `functional.h`.
C++14 constexpr version should be inside of C++14, but moved before `functional.h`.
@hideakitai
Copy link
Owner

Oops, I missed compile error on tests/arduino_stl.ino... and fixed it.

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