Skip to content

Commit

Permalink
Merge pull request #153 from LLNL/feature/burmark1/tuple_size
Browse files Browse the repository at this point in the history
Allow std tuple_size and tuple_element before C++17
  • Loading branch information
MrBurmark authored Jun 11, 2024
2 parents 1a2050b + 70fed70 commit 8cf15aa
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
2 changes: 0 additions & 2 deletions include/camp/array.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,6 @@ namespace camp {
#endif
} // namespace camp

#if defined(__cplusplus) && __cplusplus >= 201703L
// For structured bindings
namespace std {
template <class T, std::size_t N>
Expand All @@ -288,7 +287,6 @@ namespace std {
using type = T;
};
}
#endif

#endif // !defined(CAMP_ARRAY_H)

2 changes: 0 additions & 2 deletions include/camp/tuple.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,6 @@ auto operator<<(std::ostream& os, camp::tuple<Args...> const& tup)
return os << ")";
}

#if defined(__cplusplus) && __cplusplus >= 201703L
namespace std {
/// This allows structured bindings to be used with camp::tuple
/// e.g. auto t = make_tuple(1, 2.0);
Expand Down Expand Up @@ -721,6 +720,5 @@ namespace std {
using type = ::camp::tuple_element_t<i, camp::tagged_tuple<TagList, Elements...>>;
};
} // namespace std
#endif

#endif /* camp_tuple_HPP__ */
3 changes: 2 additions & 1 deletion test/array.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,6 @@ CAMP_TEST_BEGIN(array, to_array)
b[2] == 10;
} CAMP_TEST_END(array, to_array)

#if defined(__cplusplus) && __cplusplus >= 201703L

CAMP_TEST_BEGIN(array, tuple_size)
{
Expand All @@ -379,6 +378,8 @@ CAMP_TEST_BEGIN(array, tuple_element)
element4;
} CAMP_TEST_END(array, tuple_element)

#if defined(__cplusplus) && __cplusplus >= 201703L

CAMP_TEST_BEGIN(array, structured_binding)
{
camp::array<int, 2> a{-1, 1};
Expand Down

0 comments on commit 8cf15aa

Please sign in to comment.