mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-29 09:03:14 +08:00
Change-Id: I78bf6a82df3399a2b79143333989bac81e7a392a Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
21 lines
332 B
C++
21 lines
332 B
C++
/*
|
|
* Copyright (C) 2017-2020 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <stddef.h>
|
|
|
|
template <typename T, size_t N>
|
|
constexpr size_t arrayCount(const T (&)[N]) {
|
|
return N;
|
|
}
|
|
|
|
template <typename T, size_t N>
|
|
constexpr bool isInRange(size_t idx, const T (&)[N]) {
|
|
return (idx < N);
|
|
}
|