tuple.hpp: remove duplicated code