RadixSet - a growing-only radix/patricia tree
As Olzhas Zhumabek mentioned in the comments, the allocation and de-allocation is poorly done and cause undefined behavior, which will most likely cause a segmentation fault.

First, the allocation in the insert function: every time you insert, you're overwriting the previous node with the line node-&gt;children[c] = new radixset;, and it's a bug that your tests do not cover (happens in the case of inserting two words with the same prefix), so you haven't noticed it. Also, it would be better to allocate all the children upfront to avoid pointing to garbage; so, the insert function becomes:

void insert(std::string str) {
   radixset* node = this;
   for (unsigned char c : str) {
      if (node-&gt;children == nullptr) {
         node-&gt;children = new radixset*[256];
         for (auto i = 0; i &lt; 256; i++) {
            node-&gt;children[i] = new radixset;
         }
      }
      node = node-&gt;children[c];
   }
   node-&gt;isword = true;
}


Then, the de-allocation. Whenever you allocate using new[] you must de-allocate using delete[], and not just delete. The allocations to the recursive radixset structure do not use the subscript allocation, so their delete also do not use the subscript.

~radixset() {
   if (children != nullptr) {
      for (auto i = 0; i &lt; 256; i++) {
         delete children[i];
      }
      delete[] children;
   }
}


And don't forget to add the non-tested case to the test cases! (Note: I have changed the tests from cassert to GoogleTest).

TEST (RadixSetInsert, MatchingPrefixLongerFirst) {
   radixset r = radixset{};
   r.insert("abc");
   r.insert("ab");
   ASSERT_TRUE(r.contains("ab"));
   ASSERT_TRUE(r.contains("abc"));
}

TEST (RadixSetInsert, MatchingPrefixShorterFirst) {
   radixset r = radixset{};
   r.insert("ab");
   r.insert("abc");
   ASSERT_TRUE(r.contains("ab"));
   ASSERT_TRUE(r.contains("abc"));
}




Actually, the memory usage for sparse data sets is way too much in this implementation. To avoid allocating too much and still not pointing to garbage, point to nullptr and allocate as needed:

if (node-&gt;children == nullptr) {
    node-&gt;children = new radixset*[256];
    for (auto i = 0; i &lt; 256; i++) {
        node-&gt;children[i] = nullptr;
    }
}
if (node-&gt;children[c] == nullptr) {
    node-&gt;children[c] = new radixset;
}


And check for nullptr properly when deleting the children members.