0
0
Fork 0
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:
Jason Volk 2020-11-01 06:13:24 -08:00
parent 3bdc26765b
commit 01385aab2d

View file

@ -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
//