rapidcheck generator for a struct with a c style array as member

122 views Asked by At

Suppose I have the following struct:

struct Data {
    float zs[50];
};

I'm trying to create a rapidcheck generator similarly to the ones defined here such as:

// NOTE: Must be in rc namespace!
namespace rc {

template<>
struct Arbitrary<Person> {
  static Gen<Person> arbitrary() {
    return gen::build<Person>(
        gen::set(&Person::firstName),
        gen::set(&Person::lastName),
        gen::set(&Person::age, gen::inRange(0, 100)));
  }
};

} // namespace rc

Is this possible?

0

There are 0 answers