First experiments

This commit is contained in:
John Wellbelove 2021-11-04 12:15:14 +01:00
parent 4068482bd5
commit dd77b4ec70
2 changed files with 18 additions and 0 deletions

View File

@ -561,6 +561,15 @@ namespace etl
-> array<etl::enable_if_t<(etl::is_same_v<T, Ts> && ...), T>, 1U + sizeof...(Ts)>;
#endif
#if ETL_CPP11_SUPPORTED
template <typename... T>
constexpr auto make_array(T&&... t)
-> etl::array<std::common_type_t<T...>, sizeof...(T)>
{
return { { etl::forward<T>(t)... } };
}
#endif
//*************************************************************************
/// Overloaded swap for etl::array<T, SIZE>
///\param lhs The first array.

View File

@ -644,5 +644,14 @@ namespace
CHECK(data >= data);
CHECK(!(lesser >= data));
}
//*************************************************************************
TEST(test_make_array)
{
auto data = etl::make_array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9);
CHECK_EQUAL(5, data[5]);
}
};
}