mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 06:48:06 +02:00
clover: Allow storing a range into a container of different (but compatible) element type.
Tested-by: Tom Stellard <thomas.stellard@amd.com>
This commit is contained in:
parent
1b9fb2fd91
commit
d82b39ce38
1 changed files with 7 additions and 7 deletions
|
|
@ -38,25 +38,25 @@ namespace clover {
|
|||
template<typename T, typename V>
|
||||
struct range_store_traits;
|
||||
|
||||
template<typename T>
|
||||
struct range_store_traits<T, std::vector<T>> {
|
||||
template<typename T, typename S>
|
||||
struct range_store_traits<T, std::vector<S>> {
|
||||
typedef void enable;
|
||||
|
||||
template<typename R>
|
||||
static std::vector<T>
|
||||
static std::vector<S>
|
||||
create(const R &r) {
|
||||
return { r.begin(), r.end() };
|
||||
}
|
||||
};
|
||||
|
||||
template<typename T, std::size_t N>
|
||||
struct range_store_traits<T, std::array<T, N>> {
|
||||
template<typename T, typename S, std::size_t N>
|
||||
struct range_store_traits<T, std::array<S, N>> {
|
||||
typedef void enable;
|
||||
|
||||
template<typename R>
|
||||
static std::array<T, N>
|
||||
static std::array<S, N>
|
||||
create(const R &r) {
|
||||
std::array<T, N> v;
|
||||
std::array<S, N> v;
|
||||
assert(r.size() == v.size());
|
||||
copy(r, v.begin());
|
||||
return v;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue