diff options
Diffstat (limited to 'basic_traits.h')
| -rw-r--r-- | basic_traits.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/basic_traits.h b/basic_traits.h new file mode 100644 index 0000000..45aaba9 --- /dev/null +++ b/basic_traits.h @@ -0,0 +1,27 @@ +#ifndef ALGDS_BAISC_TRAITS_H_ +#define ALGDS_BAISC_TRAITS_H_ + +#include <stdio.h> + +#include "type_alias.h" + +// basic traits +#define BASIC_TRAITS_DEF(T) \ + Bool T##_eq(T lhs, T rhs); \ + Int T##_cmp(T lhs, T rhs); \ + uint64_t T##_hash(T x); \ + void T##_show(T x, FILE* fp); \ + +BASIC_TRAITS_DEF(Int); +BASIC_TRAITS_DEF(Bool); +BASIC_TRAITS_DEF(Long); +BASIC_TRAITS_DEF(Char); +BASIC_TRAITS_DEF(UInt); +BASIC_TRAITS_DEF(ULong); +BASIC_TRAITS_DEF(Double); +BASIC_TRAITS_DEF(Float); +BASIC_TRAITS_DEF(VoidPtr); +BASIC_TRAITS_DEF(String); + + +#endif |
