template<typename T, typename U = T>
struct tts::ramp< T, U >
Defines a data generator that produce a ramp of data.
This generator produces a ramp starting from an initial value and increasing by a fixed step at each call. I.e., for a size N, the produced values are: start, start+step, start+2*step, ...,
start+(N-1)*step.
- 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));
}
}
};