You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are parts of the ImageSharp codebase that were written before C# 7.3 came out, so in particular there are two missing features: the unmanaged type constraint, and the readonly modifier for struct types, or struct members.
We should consider doing a polishing pass around the codebase, including:
Upgrading all the various struct constraints to unmanaged (eg. in where TPixel : unmanaged, IPixel<TPixel>, instead of the previous where TPixel : struct, IPixel<TPixel>)
Marking all the struct-s, or at least all the various method/property getters/etc. as readonly as possible (this is more expressive and avoids safety copies by the compiler)
In particular, some of these changes were in the (now reverted) commits in #1107: 4b7718e.
Roadmap
The plan now is to wait for #1107 and #1109 to be merged, and then proceed with these changes. Side note: another unrelated follow up to do when those PRs get merged is to reintroduce the changes from 1835475 and customize processors to let them pick the right value delegate depending on their needs.
The text was updated successfully, but these errors were encountered:
This follows from a conversation with @JimBobSquarePants on gitter.
Overview
There are parts of the
ImageSharp
codebase that were written before C# 7.3 came out, so in particular there are two missing features: theunmanaged
type constraint, and thereadonly
modifier forstruct
types, orstruct
members.We should consider doing a polishing pass around the codebase, including:
struct
constraints to unmanaged (eg. inwhere TPixel : unmanaged, IPixel<TPixel>
, instead of the previouswhere TPixel : struct, IPixel<TPixel>
)struct
-s, or at least all the various method/property getters/etc. asreadonly
as possible (this is more expressive and avoids safety copies by the compiler)In particular, some of these changes were in the (now reverted) commits in #1107: 4b7718e.
Roadmap
The plan now is to wait for #1107 and #1109 to be merged, and then proceed with these changes. Side note: another unrelated follow up to do when those PRs get merged is to reintroduce the changes from 1835475 and customize processors to let them pick the right value delegate depending on their needs.
The text was updated successfully, but these errors were encountered: