public static class Extensions { public static string decode_name(this Span<byte> name) { // ... }}
public static class Extensions { public static string decode_name(this Span<byte> name) { // ... }}
and then have that extension appear over all inline array types of
byte
byte
as such:
public struct CHRDATA { public ByteArray20 chr_name; public ByteArray40 chr_name_extended; public void test() { string str_chr_name = chr_name.decode_name(); string str_chr_name_extended = chr_name_extended.decode_name(); }}
public struct CHRDATA { public ByteArray20 chr_name; public ByteArray40 chr_name_extended; public void test() { string str_chr_name = chr_name.decode_name(); string str_chr_name_extended = chr_name_extended.decode_name(); }}
or is that not covered by that proposal? If not, can this (defining a single extension method for any inline array of a given primitive) be achieved in some other way?