Files
compute-runtime/core/helpers/array_count.h
Mateusz Hoppe 522dedfbd2 Move files to core
Change-Id: I78bf6a82df3399a2b79143333989bac81e7a392a
Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2020-01-29 12:21:40 +01:00

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);
}