23# error "1byte is must be 8bit"
35 template <
typename... Args>
38 return argsUnpack(std::forward<Args>(args)...);
43 template <
typename Head,
typename... Tail>
44 constexpr ResultType argsUnpack(Head&& head, Tail&&... tail)
const noexcept
46 return Sizeof<Head&&>::value(*
this, std::forward<Head>(head)) +
47 argsUnpack(std::forward<Tail>(tail)...);
51 constexpr ResultType argsUnpack() const noexcept {
return 0; }
56 template <
typename T,
typename =
void>
59 static constexpr ResultType value(...) noexcept
62 static_assert(AlwaysFalse<T>::value,
"T is not sizable!" __FUNCTION__);
64 static_assert(AlwaysFalse<T>::value,
"T is not sizable!");
71 template <
typename Bool>
74 static constexpr ResultType value(...) noexcept {
return 1; }
78 template <
typename Integral>
81 static constexpr ResultType value(...) noexcept {
return sizeof(Integral) * CHAR_BIT; }
85 template <
typename Float>
88 static constexpr ResultType value(...) noexcept {
return sizeof(Udon::Float32) * CHAR_BIT; }
92 template <
typename Enum>
95 static constexpr ResultType value(...) noexcept {
return sizeof(Enum) * CHAR_BIT; }
99 template <
typename Array>
102 static constexpr ResultType value(
const SerializedBitSizeImpl& self, Array&& array)
noexcept
104 using ElementT =
typename std::remove_extent<RemoveReferenceT<Array>>::type;
105 return Sizeof<ElementT>::value(self, std::forward<ElementT>(*array)) * std::extent<RemoveReferenceT<Array>>::value;
110 template <
typename Enumerable>
113 static constexpr ResultType value(
const SerializedBitSizeImpl& self, Enumerable&& e)
noexcept
115 return e.enumerate(self);
std::is_enum< T > IsEnum
Definition Typedef.hpp:49
RemoveConstT< RemoveVolatileT< RemoveReferenceT< T > > > RemoveCVRefT
Definition Typedef.hpp:28
std::is_floating_point< T > IsFloatingPoint
Definition Typedef.hpp:40
EnableIfT< Test, void > EnableIfVoidT
Definition Typedef.hpp:69
typename std::remove_reference< T >::type RemoveReferenceT
Definition Typedef.hpp:25
std::integral_constant< bool, IsIntegral< T >::value and not IsBool< T >::value > IsIntegralNotBool
Definition Typedef.hpp:37
std::is_same< T, bool > IsBool
Definition Typedef.hpp:31
std::is_array< T > IsArray
Definition Typedef.hpp:52
Definition SerializedSize.hpp:31
size_t ResultType
Definition SerializedSize.hpp:33
constexpr ResultType operator()(Args &&... args) const noexcept
Definition SerializedSize.hpp:36