mirror of
https://github.com/matrix-construct/construct
synced 2025-01-13 08:23:56 +01:00
ircd::util: Add ssizeof() convenience template.
This commit is contained in:
parent
3bdc26765b
commit
01385aab2d
1 changed files with 18 additions and 0 deletions
|
@ -89,6 +89,24 @@ struct NAME \
|
|||
template<size_t SIZE>
|
||||
struct _TEST_SIZEOF_;
|
||||
|
||||
//
|
||||
// signed sizeof
|
||||
//
|
||||
|
||||
template<class T>
|
||||
constexpr ssize_t
|
||||
ssizeof(T&&)
|
||||
{
|
||||
return sizeof(T);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
constexpr ssize_t
|
||||
ssizeof()
|
||||
{
|
||||
return sizeof(T);
|
||||
}
|
||||
|
||||
//
|
||||
// Test if type is forward declared or complete
|
||||
//
|
||||
|
|
Loading…
Reference in a new issue