void split(Pred pred, PB_DS_CLASS_C_DEC& other) { base_type tmp; other.clear(); while (!base_type::empty()) { if (!pred(base_type::top())) tmp.push(base_type::top()); else other.push(base_type::top()); base_type::pop(); } *static_cast<base_type*>(this) = tmp; }