// // EnumSubset.swift // VDS // // Created by Matt Bruce on 12/19/22. // import Foundation public protocol EnumSubset: RawRepresentable, CaseIterable, Valuing { associatedtype T:RawRepresentable var defaultValue: T { get } } extension EnumSubset where RawValue == T.RawValue { /// Will either return the Generic RawRepresentable object or the defaultValue public var value: T { T(rawValue: rawValue) ?? defaultValue } }