CppCommon
1.0.5.0
C++ Common Library
Loading...
Searching...
No Matches
include
utility
countof.h
Go to the documentation of this file.
1
9
#ifndef CPPCOMMON_UTILITY_COUNTOF_H
10
#define CPPCOMMON_UTILITY_COUNTOF_H
11
12
namespace
CppCommon
{
13
15
template
<
typename
T,
size_t
N>
16
constexpr
size_t
countof
(
const
T (&)[N])
noexcept
{
return
N; }
17
19
template
<
typename
T>
20
size_t
countof
(
const
T& container)
noexcept
{
return
container.size(); }
21
22
}
// namespace CppCommon
23
24
#endif
// CPPCOMMON_UTILITY_COUNTOF_H
CppCommon
C++ Common project definitions.
Definition
token_bucket.h:15
CppCommon::countof
constexpr size_t countof(const T(&)[N]) noexcept
Count of elements in static array.
Definition
countof.h:16
Generated by
1.9.8