Cast anonymous enum to avoid instantiating Boost.Range operators