return e;
}
-#define LL_DELETE(...) EVAL(OVERLOAD(LL_DELETE, __VA_ARGS__))
-#define LL_DELETE_1(this) LL_DELETE_2(this, LAMBDA())
-#define LL_DELETE_2(this, dtor) \
+#define LL_CLEAR(...) EVAL(OVERLOAD(LL_CLEAR, __VA_ARGS__))
+#define LL_CLEAR_1(this) LL_CLEAR_2(this, LAMBDA())
+#define LL_CLEAR_2(this, dtor) \
do \
{ \
LinkedList _ll = this; \
dtor \
remove(it); \
} \
- remove(_ll); \
+ } \
+ while (0)
+
+#define LL_DELETE(...) EVAL(OVERLOAD(LL_DELETE, __VA_ARGS__))
+#define LL_DELETE_1(this) LL_DELETE_2(this, LAMBDA())
+#define LL_DELETE_2(this, dtor) \
+ do \
+ { \
+ LL_CLEAR(this, dtor); \
+ remove(this); \
this = NULL; \
} \
while (0)