Improve type safety of std::set