-
Notifications
You must be signed in to change notification settings - Fork 537
Open
Description
We use dynamic calls in C# to resolve symbols for C++ constants. This has the following three problems:
- It's much slower than reading a hard-coded value;
- It prevents constants from being used in default values of parameters, attributes and anywhere else a compile-time value is required;
- It's needlessly complex because constants rarely if ever change their values across versions; also, because of the tight integration C++# creates between the binding and the native library it's unsafe anyway to use a binding generated for one version with a newer one.
We can actually support (in most cases) complex constants (objects) too by using C# read-only fields. But let's just start with primitive constants: integers, Booleans, possibly strings.
Metadata
Metadata
Assignees
Labels
No labels