Updated all array_view uses with the C++20 span. (#7157)

* Updated all array_view uses with the C++20 span.

The updates were done in the following order
1. `AZStd::array_view<([^>].+)\* ?>`  -> `AZStd::span<\1 const>`
2. `AZStd::array_view<(?:const )(.+)>` -> `AZStd::span<const \1>`
3. `AZStd::array_view` -> `AZStd::span`

Removed the implementation of array_view.

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>

* Added missing whitespace between `const` and the typename for spans.

Updated the ShaderTest comparison of the ShaderResourceGroupLayout span
to compare the sizes as well

Updated comments on some of the methods that stated that they return "an
array" to mention they return "a span".

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
This commit is contained in:
lumberyard-employee-dm
2022-01-26 16:15:47 -06:00
committed by GitHub
parent 48cea89910
commit b9824ed172
170 changed files with 833 additions and 1274 deletions
@@ -95,9 +95,9 @@ namespace AZ
return m_indexBufferAssetView;
}
AZStd::array_view<ModelLodAsset::Mesh::StreamBufferInfo> ModelLodAsset::Mesh::GetStreamBufferInfoList() const
AZStd::span<const ModelLodAsset::Mesh::StreamBufferInfo> ModelLodAsset::Mesh::GetStreamBufferInfoList() const
{
return AZStd::array_view<ModelLodAsset::Mesh::StreamBufferInfo>(m_streamBufferInfo);
return AZStd::span<const ModelLodAsset::Mesh::StreamBufferInfo>(m_streamBufferInfo);
}
void ModelLodAsset::AddMesh(const Mesh& mesh)
@@ -109,9 +109,9 @@ namespace AZ
m_aabb.AddAabb(meshAabb);
}
AZStd::array_view<ModelLodAsset::Mesh> ModelLodAsset::GetMeshes() const
AZStd::span<const ModelLodAsset::Mesh> ModelLodAsset::GetMeshes() const
{
return AZStd::array_view<ModelLodAsset::Mesh>(m_meshes);
return AZStd::span<const ModelLodAsset::Mesh>(m_meshes);
}
const AZ::Aabb& ModelLodAsset::GetAabb() const
@@ -121,7 +121,7 @@ namespace AZ
const BufferAssetView* ModelLodAsset::Mesh::GetSemanticBufferAssetView(const AZ::Name& semantic) const
{
const AZStd::array_view<ModelLodAsset::Mesh::StreamBufferInfo>& streamBufferList = GetStreamBufferInfoList();
const AZStd::span<const ModelLodAsset::Mesh::StreamBufferInfo>& streamBufferList = GetStreamBufferInfoList();
for (const ModelLodAsset::Mesh::StreamBufferInfo& streamBufferInfo : streamBufferList)
{