Add a cast for DMD not figuring out an implicit conversion in a pure function.