Skip to content

Commit

Permalink
iox-eclipse-iceoryx#1934 Alias invoke_result to correct implementatio…
Browse files Browse the repository at this point in the history
…n based on C++ version
  • Loading branch information
alban-apexai committed Apr 3, 2023
1 parent 207d419 commit d42eaca
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions doc/website/release-notes/iceoryx-unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
- Fix potential memory leak in `iox::stack` [\#1893](https://github.com/eclipse-iceoryx/iceoryx/issues/1893)
- Make `MAX_USER_NAME_LENGTH` and `MAX_GROUP_NAME_LENGTH` platform-dependent [\#1919](https://github.com/eclipse-iceoryx/iceoryx/issues/1919)
- Fix milliseconds in log timestamps [\#1932](https://github.com/eclipse-iceoryx/iceoryx/issues/1932)
- Alias `invoke_result` to correct implementation based on C++ version [\#1934](https://github.com/eclipse-iceoryx/iceoryx/issues/1934)

**Refactoring:**

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,13 @@ constexpr const char IOX_LOCK_FILE_PATH_PREFIX[] = "/tmp/";
constexpr uint64_t MAX_USER_NAME_LENGTH = 32;
constexpr uint64_t MAX_GROUP_NAME_LENGTH = 32;

#if __cplusplus >= 201703L
template <typename C, typename... Cargs>
using invoke_result = std::invoke_result<C(Cargs...)>;
#else
template <typename C, typename... Cargs>
using invoke_result = std::result_of<C(Cargs...)>;
#endif
} // namespace platform
} // namespace iox

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,13 @@ constexpr const char IOX_LOCK_FILE_PATH_PREFIX[] = "/tmp/";
constexpr uint64_t MAX_USER_NAME_LENGTH = 32;
constexpr uint64_t MAX_GROUP_NAME_LENGTH = 16;

#if __cplusplus >= 201703L
template <typename C, typename... Cargs>
using invoke_result = std::invoke_result<C, Cargs...>;
using invoke_result = std::invoke_result<C(Cargs...)>;
#else
template <typename C, typename... Cargs>
using invoke_result = std::result_of<C(Cargs...)>;
#endif

} // namespace platform
} // namespace iox
Expand Down

0 comments on commit d42eaca

Please sign in to comment.