Derive-C
Loading...
Searching...
No Matches
trait.h File Reference
#include <derive-c/core/prelude.h>
#include <stdbool.h>

Go to the source code of this file.

Macros

#define DC_TRAIT_BITSET(SELF)

Macro Definition Documentation

◆ DC_TRAIT_BITSET

#define DC_TRAIT_BITSET ( SELF)
Value:
DC_REQUIRE_METHOD(NS(SELF, index_t), SELF, max_index, (void)); \
DC_REQUIRE_METHOD(NS(SELF, index_t), SELF, min_index, (void)); \
DC_REQUIRE_METHOD(bool, SELF, try_set, (SELF*, NS(SELF, index_t), bool)); \
DC_REQUIRE_METHOD(void, SELF, set, (SELF*, NS(SELF, index_t), bool)); \
DC_REQUIRE_METHOD(bool, SELF, get, (SELF const*, NS(SELF, index_t))); \
DC_REQUIRE_METHOD(NS(SELF, index_t), SELF, size, (SELF const*)); \
DC_TRAIT_ITERABLE(SELF); \
DC_TRAIT_CLONEABLE(SELF); \
DC_TRAIT_DELETABLE(SELF); \
DC_TRAIT_DEBUGABLE(SELF);
static INDEX_TYPE size(SELF const *self)
Definition template.h:252
static INDEX_TYPE min_index()
Definition template.h:36
INDEX_TYPE index_t
Definition template.h:32
static INDEX_TYPE max_index()
Definition template.h:34
static void set(SELF *self, INDEX_TYPE index, bool value)
Definition template.h:74
static bool try_set(SELF *self, INDEX_TYPE index, bool value)
Definition template.h:54
#define NS(pre, post)
Definition namespace.h:4
static nullalloc get()
Definition null.h:14
#define DC_REQUIRE_TYPE(obj, name)
Definition require.h:21
#define SELF
Definition def.h:52

Definition at line 6 of file trait.h.

6#define DC_TRAIT_BITSET(SELF) \
7 DC_REQUIRE_TYPE(SELF, index_t); \
8 DC_REQUIRE_METHOD(NS(SELF, index_t), SELF, max_index, (void)); \
9 DC_REQUIRE_METHOD(NS(SELF, index_t), SELF, min_index, (void)); \
10 DC_REQUIRE_METHOD(bool, SELF, try_set, (SELF*, NS(SELF, index_t), bool)); \
11 DC_REQUIRE_METHOD(void, SELF, set, (SELF*, NS(SELF, index_t), bool)); \
12 DC_REQUIRE_METHOD(bool, SELF, get, (SELF const*, NS(SELF, index_t))); \
13 DC_REQUIRE_METHOD(NS(SELF, index_t), SELF, size, (SELF const*)); \
14 DC_TRAIT_ITERABLE(SELF); \
15 DC_TRAIT_CLONEABLE(SELF); \
16 DC_TRAIT_DELETABLE(SELF); \
17 DC_TRAIT_DEBUGABLE(SELF);