Browse Source

Avoid ambiguous overloads when passing Containers::Array to BufferImage.

pull/107/head
Vladimír Vondruš 11 years ago
parent
commit
0df7b1b40d
  1. 6
      src/Magnum/BufferImage.h

6
src/Magnum/BufferImage.h

@ -85,6 +85,8 @@ template<UnsignedInt dimensions> class BufferImage {
/* To avoid decay of sized arrays and nullptr to const void* and
unwanted use of deprecated function */
template<class T, std::size_t dataSize> explicit BufferImage(PixelFormat format, PixelType type, const VectorTypeFor<dimensions, Int>& size, const T(&data)[dataSize], BufferUsage usage): BufferImage{{}, format, type, size, Containers::ArrayView<const void>{data}, usage} {}
/* To avoid ambiguous overload when passing Containers::Array */
template<class T> explicit BufferImage(PixelFormat format, PixelType type, const VectorTypeFor<dimensions, Int>& size, const Containers::Array<T>& data, BufferUsage usage): BufferImage{{}, format, type, size, Containers::ArrayView<const void>{data}, usage} {}
#endif
#endif
@ -193,6 +195,10 @@ template<UnsignedInt dimensions> class BufferImage {
template<class T, std::size_t dataSize> void setData(PixelFormat format, PixelType type, const VectorTypeFor<dimensions, Int>& size, const T(&data)[dataSize], BufferUsage usage) {
setData({}, format, type, size, Containers::ArrayView<const void>{data}, usage);
}
/* To avoid ambiguous overload when passing Containers::Array */
template<class T> void setData(PixelFormat format, PixelType type, const VectorTypeFor<dimensions, Int>& size, const Containers::Array<T>& data, BufferUsage usage) {
setData({}, format, type, size, Containers::ArrayView<const void>{data}, usage);
}
#endif
#endif

Loading…
Cancel
Save