summaryrefslogtreecommitdiffhomepage
path: root/dev/Boot/BootKit/Shared/base.h
blob: 1270b36a0bf4821c9e87ec30bfbcade9f0283761 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#ifndef UTL_BASE_H
#define UTL_BASE_H

#include <cstdint>
#include <cstddef>
#include <cmath>

namespace utl
{

	/**
	 * @brief Helper to get number of elements in array.
	 *
	 * @tparam T Auto-deduced element type
	 * @tparam N Auto-deduced number of elements
	 * @return Array size
	 */
	template <class T, size_t N>
	constexpr size_t countof(T (&)[N])
	{
		return N;
	}

} // namespace utl

#endif