tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
algorithm.cpp
// SPDX-License-Identifier: BSL-1.0
#undef NDEBUG
#include <etl/cassert.hpp>
#include <etl/vector.hpp>
auto main() -> int
{
vec.push_back(1.0);
vec.push_back(2.0);
vec.push_back(3.0);
vec.push_back(4.0);
// FIND
auto* const result1 = etl::find(vec.begin(), vec.end(), 3.0);
assert(result1 != vec.end());
auto* const result2 = etl::find(vec.begin(), vec.end(), 5.0);
assert(result2 == vec.end());
return 0;
}
#define assert(...)
Definition cassert.hpp:19
constexpr auto find(InputIt first, InputIt last, T const &value) noexcept -> InputIt
Searches for an element equal to value.
Definition find.hpp:18
Dynamically-resizable fixed-capacity vector.
Definition static_vector.hpp:329
constexpr auto push_back(U &&value) noexcept(noexcept(emplace_back(etl::forward< U >(value)))) -> void
Appends value at the end of the vector.
Definition static_vector.hpp:423