Wrap + add methods?

Steven Schveighoffer schveiguy at gmail.com
Mon Jun 28 15:17:34 UTC 2021


I have a situation where I want to wrap a certain type to add a few 
methods to that type.

UFCS is not an option, because the library that will use this type will 
not import the UFCS methods.

`std.typecons.Proxy` doesn't seem to wrap static methods, and besides, I 
want to return wrappers if the function being wrapped returns the same 
type (this is critical for stuff like `auto result = a + b`, I want the 
result to be the same wrapped type).

Are there any libraries that might do this (including Phobos)?

-Steve


More information about the Digitalmars-d-learn mailing list