pcm/*: use std::span instead of ConstBuffer

This commit is contained in:
Max Kellermann
2022-07-04 15:27:03 +02:00
parent d89136b09c
commit 4ce1dae673
58 changed files with 572 additions and 595 deletions

View File

@@ -17,12 +17,11 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "util/ConstBuffer.hxx"
#include <gtest/gtest.h>
#include <array>
#include <random>
#include <span>
#include <stddef.h>
#include <stdint.h>
@@ -81,12 +80,12 @@ public:
return begin();
}
operator ConstBuffer<T>() const {
operator std::span<const T>() const {
return { begin(), size() };
}
operator ConstBuffer<void>() const {
return { begin(), size() * sizeof(T) };
operator std::span<const std::byte>() const {
return { (const std::byte *)begin(), size() * sizeof(T) };
}
};