template<typename T, typename U = T>
struct tts::ramp< T, U >
Generates a ramp of values.
The element at index i of a sequence is start + i*step, the step being 1 when none is given, which for a size N gives start, start+step, ..., start+(N-1)*step. A scalar target gets start.
- Template Parameters
-
| T | Type of the initial value |
| U | Type of the step value |
#define TTS_MAIN
#include <tts/tts.hpp>
#include <array>
(std::array<float, 10>, int, double),
<typename T>(T const& ramp1, T const& ramp2)
{
if constexpr(std::is_arithmetic_v<T>)
{
}
else
{
for(std::size_t i = 0; i < ramp1.size(); ++i)
{
TTS_EQUAL(ramp1[ i ],
static_cast<typename T::value_type
>(65 + i));
}
for(std::size_t i = 0; i < ramp2.size(); ++i)
{
TTS_EQUAL(ramp2[ i ],
static_cast<typename T::value_type
>(1 + i * 2));
}
}
};