Function to return a struct with an unconstrained field

In reply to dave_59:

Thank you Dave. This is a very elegant solution. Do you have any reason to believe I would run into trouble with synthesis support using your solution? And would you have recommended I take a different approach (such as using a parameterized class)?