Click here to Skip to main content
15,178,226 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
What does this code that has no body do?
Source code

C#
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Property)]
internal class JitIntrinsicAttribute : Attribute
{

}


Edit:
I know what the attribute is for, it's more about the empty method. How does it work that even though it is empty, it still sets that attribute. Is it just the name of the method and when the compiler encounters it, it sets the attribute?


What I have tried:

I have only used the attributes in square brackets sporadically, but I don't really understand them.
Posted
Updated 21-Jul-21 21:46pm
v3

1 solution

The JitIntrinsic attribute is a legacy version of the Intrinsic attribute. My limited understanding of it is that it's used to signal that a method/property/field can be optimized by the JIT.

.net - What does the [Intrinsic] attribute in C# do? - Stack Overflow[^]
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900