Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue #931 #932

Merged
merged 2 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion include/etl/pool.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ namespace etl

//*************************************************************************
/// Allocate an object from the pool.
/// Uses the default constructor.
/// If asserts or exceptions are enabled and there are no more free items an
/// etl::pool_no_allocation if thrown, otherwise a null pointer is returned.
/// Static asserts if the specified type is too large for the pool.
Expand Down
4 changes: 2 additions & 2 deletions include/etl/vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -1376,7 +1376,7 @@ namespace etl
template <typename... T>
constexpr auto make_vector(T&&... t) -> etl::vector<typename etl::common_type_t<T...>, sizeof...(T)>
{
return { { etl::forward<T>(t)... } };
return { etl::forward<T>(t)... };
}
#endif

Expand Down Expand Up @@ -1674,7 +1674,7 @@ namespace etl
template <typename... T>
constexpr auto make_vector(T*... t) -> etl::vector<typename etl::common_type_t<T*...>, sizeof...(T)>
{
return { { etl::forward<T*>(t)... } };
return { etl::forward<T*>(t)... };
}
#endif

Expand Down
23 changes: 23 additions & 0 deletions test/test_vector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1495,6 +1495,29 @@ namespace
}
#endif

//*************************************************************************
#if ETL_HAS_INITIALIZER_LIST
TEST(test_make_vector_issue_931_two_pairs)
{
auto data3 = etl::make_vector(etl::make_pair(1, 2),
etl::make_pair(3, 4),
etl::make_pair(5, 6));
CHECK_EQUAL(1, data3[0].first);
CHECK_EQUAL(2, data3[0].second);
CHECK_EQUAL(3, data3[1].first);
CHECK_EQUAL(4, data3[1].second);
CHECK_EQUAL(5, data3[2].first);
CHECK_EQUAL(6, data3[2].second);

auto data2 = etl::make_vector(etl::make_pair(1, 2),
etl::make_pair(3, 4));
CHECK_EQUAL(1, data3[0].first);
CHECK_EQUAL(2, data3[0].second);
CHECK_EQUAL(3, data3[1].first);
CHECK_EQUAL(4, data3[1].second);
}
#endif

//*************************************************************************
TEST(test_fill)
{
Expand Down
Loading