Skip to content

Commit

Permalink
Adjust Arachne type checks for different C++ versions
Browse files Browse the repository at this point in the history
This commit addresses potential compatibility issues with different
versions of C++ by adding conditionals to the `junction` concept in the
`arachne.h` utility file. As some versions may not support the
`std::integral` check, we fall back to directly assessing `val.w` if
the C++ version is older or a particular library version with
compatibility issues is detected. This change ensures successful
compilation across varying environments.

Contributes to CURA-10724
  • Loading branch information
jellespijker committed Jul 1, 2023
1 parent 5cd147b commit 414f9c6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions include/utils/types/arachne.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,12 @@ template<class T>
concept junction = requires(T val)
{
requires point2d<decltype(val.p)>;
#if (__cplusplus > 201703L) && (!defined(_LIBCPP_VERSION) || (__clang_major__ > 13))
// https://stackoverflow.com/questions/71818683/stdintegral-not-found-in-clang13-c20-error
requires std::integral<decltype(val.w)>;
#else
val.w;
#endif
};

/*!
Expand Down

0 comments on commit 414f9c6

Please sign in to comment.