Converting infinity assert to template restraint

Per review request