mirror of
https://github.com/matrix-construct/construct
synced 2024-12-29 08:54:02 +01:00
ircd: Add these participating size() and data() overloads for C arrays.
This commit is contained in:
parent
03dea97bb2
commit
6b287f958c
1 changed files with 36 additions and 0 deletions
|
@ -383,6 +383,42 @@ size(std::ostream &s)
|
|||
return ret;
|
||||
}
|
||||
|
||||
template<size_t SIZE>
|
||||
constexpr size_t
|
||||
size(const char (&buf)[SIZE])
|
||||
{
|
||||
return SIZE;
|
||||
}
|
||||
|
||||
template<size_t SIZE>
|
||||
constexpr size_t
|
||||
size(const std::array<const char, SIZE> &buf)
|
||||
{
|
||||
return SIZE;
|
||||
}
|
||||
|
||||
template<size_t SIZE>
|
||||
constexpr size_t
|
||||
size(const std::array<char, SIZE> &buf)
|
||||
{
|
||||
return SIZE;
|
||||
}
|
||||
|
||||
|
||||
template<size_t SIZE>
|
||||
constexpr const char *
|
||||
data(const char (&buf)[SIZE])
|
||||
{
|
||||
return buf;
|
||||
}
|
||||
|
||||
template<size_t SIZE>
|
||||
constexpr char *
|
||||
data(char (&buf)[SIZE])
|
||||
{
|
||||
return buf;
|
||||
}
|
||||
|
||||
|
||||
template<class T>
|
||||
auto
|
||||
|
|
Loading…
Reference in a new issue