mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-15 03:08:36 +12:00
Small fix
This commit is contained in:
parent
317417d541
commit
c0fdef7a12
2 changed files with 20 additions and 2 deletions
|
@ -61,6 +61,22 @@ template<typename T, typename = std::enable_if_t<std::is_integral<T>::value>> in
|
|||
return static_cast<T>((value + (align - 1)) & ~(align - 1));
|
||||
}
|
||||
|
||||
// bool wrapper for restricting bool result conversions
|
||||
struct explicit_bool_t
|
||||
{
|
||||
const bool value;
|
||||
|
||||
explicit_bool_t(bool value)
|
||||
: value(value)
|
||||
{
|
||||
}
|
||||
|
||||
explicit operator bool() const
|
||||
{
|
||||
return value;
|
||||
}
|
||||
};
|
||||
|
||||
// return 32 bit sizeof() to avoid widening/narrowing conversions with size_t
|
||||
#define sizeof32(type) sizeof32_t<sizeof(type)>::value
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue