Did some thinking: Realized that the appropriate mechanism to express that A and B are two ways of representing the same thing is to do so via opCast. I had not considered this option carefully initially as I am translating someone else's C++ code to D and hoped that they had used the appropriate representations on the C++ side.

I added the appropriate code to permit casting and I was then able to get the desired code-reuse and template constraints.

Accordingly, I no longer need an answer to my second question unless someone knows of a more idiomatic way to get the same results.

Reply via email to