<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[SNEX span unsafe index?]]></title><description><![CDATA[<p dir="auto">Whatever I do, I get an unsafe access.<br />
In a previous SNEX code, I used a normalised index for a safe LUT (span) access with no issues.<br />
But here I am struggling with not a shred of explanation...</p>
<pre><code>	span&lt;Params, NB&gt; models =
	{
		{0.0f, 0.0f, 0.0f},
		{0.0f, 0.0f, 0.0f}
	};

	using IndexType = index::clamped&lt;NB, true&gt;;
	
	Params currentModel;

	template &lt;int P&gt; void setParameter(double v)
	{
		if (P == Parameters::Model)
		{
			IndexType idx((int)v);
			currentModel = models[idx]; // unsafe access
		}
	}
</code></pre>
]]></description><link>https://forum.hise.audio/topic/10076/snex-span-unsafe-index</link><generator>RSS for Node</generator><lastBuildDate>Sat, 18 Jul 2026 05:24:57 GMT</lastBuildDate><atom:link href="https://forum.hise.audio/topic/10076.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 16 Jul 2024 16:24:10 GMT</pubDate><ttl>60</ttl></channel></rss>