Change GetValues() to take in const positions. (#6987)

* Change GetValues() to take in const positions.
To support this, span needed some template deductions to correctly convert from non-const containers to const ones.

Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>

* Removed the most problematic template deduction rules.

Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>

* Remove duplicate validate_iterator methods.
iterator type is a pointer, not a value, so "const iterator" and "const const_iterator" produce the same function signature.

Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>

* Fixed the span types.

Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
This commit is contained in:
Mike Balfour
2022-01-19 12:57:52 -06:00
committed by GitHub
parent ca56770655
commit 83878e6377
37 changed files with 55 additions and 109 deletions
@@ -134,7 +134,7 @@ namespace GradientSignal
return m_configuration.m_gradientSampler.GetValue(sampleParams);
}
void ReferenceGradientComponent::GetValues(AZStd::span<AZ::Vector3> positions, AZStd::span<float> outValues) const
void ReferenceGradientComponent::GetValues(AZStd::span<const AZ::Vector3> positions, AZStd::span<float> outValues) const
{
if (positions.size() != outValues.size())
{