Unsolved SNEX span unsafe index?
-
Whatever I do, I get an unsafe access.
In a previous SNEX code, I used a normalised index for a safe LUT (span) access with no issues.
But here I am struggling with not a shred of explanation...span<Params, NB> models = { {0.0f, 0.0f, 0.0f}, {0.0f, 0.0f, 0.0f} }; using IndexType = index::clamped<NB, true>; Params currentModel; template <int P> void setParameter(double v) { if (P == Parameters::Model) { IndexType idx((int)v); currentModel = models[idx]; // unsafe access } }
-
U ustk marked this topic as a question on