#include <string>
#include <utility>
-#ifndef NDEBUG
-#define NDEBUG 1
-#endif
-
namespace btree {
// Inside a btree method, if we just call swap(), it will choose the
// Swap the contents of "this" and "src".
void swap(btree_node *src);
+#ifdef NDEBUG
+ static constexpr auto no_debug = true;
+#else
+ static constexpr auto no_debug = false;
+#endif
// Node allocation/deletion routines.
static btree_node* init_leaf(
leaf_fields *f, btree_node *parent, int max_count) {
f->max_count = max_count;
f->count = 0;
f->parent = parent;
- if (!NDEBUG) {
+ if (!no_debug) {
memset(&f->values, 0, max_count * sizeof(value_type));
}
return n;
static btree_node* init_internal(internal_fields *f, btree_node *parent) {
btree_node *n = init_leaf(f, parent, kNodeValues);
f->leaf = 0;
- if (!NDEBUG) {
+ if (!no_debug) {
memset(f->children, 0, sizeof(f->children));
}
return n;