pcm/Format: change parameters/return values to ConstBuffer

This commit is contained in:
Max Kellermann
2014-01-06 22:42:02 +01:00
parent b0b7244b3a
commit c75339edcc
5 changed files with 192 additions and 295 deletions

View File

@@ -17,6 +17,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "util/ConstBuffer.hxx"
#include <array>
#include <random>
@@ -76,6 +78,14 @@ public:
operator typename std::array<T, N>::const_pointer() const {
return begin();
}
operator ConstBuffer<T>() const {
return { begin(), size() };
}
operator ConstBuffer<void>() const {
return { begin(), size() * sizeof(T) };
}
};
template<typename T>