Skip to content

Commit

Permalink
attempts at fixing build on macos with clang 17 and 18
Browse files Browse the repository at this point in the history
  • Loading branch information
braxtons12 committed Jun 16, 2024
1 parent 4fc1297 commit 3d6af18
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions include/hyperion/mpl/list.h
Original file line number Diff line number Diff line change
Expand Up @@ -1692,15 +1692,15 @@ namespace hyperion::mpl {
return TType{};
}
#else
/// @brief Used to extend the lifetime of the given value in a `constexpr` context.
/// MSVC can be bad about assuming an object's lifetime has ended in `constexpr`
/// contexts when it really hasn't.
///
/// This provides usage consistency w/ the hack used for MSVC.
template<typename TType>
constexpr auto extend_constexpr_lifetime(const TType& value) -> decltype(auto) {
return value;
}
///// @brief Used to extend the lifetime of the given value in a `constexpr` context.
///// MSVC can be bad about assuming an object's lifetime has ended in `constexpr`
///// contexts when it really hasn't.
/////
///// This provides usage consistency w/ the hack used for MSVC.
//template<typename TType>
//constexpr auto extend_constexpr_lifetime(TType&& value) -> decltype(auto) {
// return std::forward<TType>(value);
//}
#endif // HYPERION_PLATFORM_COMPILER_IS_MSVC

/// @brief Statically stack-allocated vector containing elements of type `TType`,
Expand Down Expand Up @@ -1865,7 +1865,12 @@ namespace hyperion::mpl {
constexpr auto indices = [](auto range_obj, MetaValue auto size) {
constexpr auto to_process = detail::iota(0_value, size);
return detail::to_vector<usize, sizeof...(TTypes)>(range_obj(to_process));
}(detail::extend_constexpr_lifetime(range_object), list.size());
}
#if HYPERION_PLATFORM_COMPILER_IS_MSVC
(detail::extend_constexpr_lifetime(range_object), list.size());
#else
(range_object, list.size());
#endif // HYPERION_PLATFORM_COMPILER_IS_MSVC

// use those indices to sift the `list`
return [indices]<auto... TIndices>(std::index_sequence<TIndices...>, auto _list) {
Expand Down

0 comments on commit 3d6af18

Please sign in to comment.