Changes in src/AST/Bitfield.hpp [461046f:93744b5]
- File:
-
- 1 edited
-
src/AST/Bitfield.hpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Bitfield.hpp
r461046f r93744b5 9 9 // Author : Aaron B. Moss 10 10 // Created On : Thu May 9 10:00:00 2019 11 // Last Modified By : A aron B. Moss12 // Last Modified On : Thu May 910:00:00 201913 // Update Count : 111 // Last Modified By : Andrew Beach 12 // Last Modified On : Wed Jun 5 10:00:00 2019 13 // Update Count : 2 14 14 // 15 15 16 16 #pragma once 17 17 18 #include <strings.h> // for ffs 18 #include <strings.h> // for ffs 19 #include <type_traits> // for is_unsigned 19 20 20 21 /// Make a type a bitfield. … … 24 25 template<typename T> 25 26 struct bitfield : public T { 26 static_assert(sizeof(T) == sizeof(unsigned int), "Type has incorrect size");27 27 using T::val; 28 28 using val_t = decltype(val); 29 static_assert(sizeof(T) == sizeof(unsigned int), "Type has incorrect size"); 30 static_assert(std::is_unsigned<val_t>::value, "Bitfield val field is not unsigned."); 29 31 30 32 constexpr bitfield() : T( 0 ) {}
Note:
See TracChangeset
for help on using the changeset viewer.