1

In the legacy spaghetti, I came across this spicy meatball:

//Keep around, might prove useful.
namespace System.Runtime.CompilerServices
{
    public sealed class IsVolatile
    {
        private IsVolatile()
        {
        }
    }
}

Is this possibly of any value? Or perhaps a better question, possibly of any harm (to retain)?

B. Clay Shannon-B. Crow Raven
  • 8,547
  • 144
  • 472
  • 862

1 Answers1

1

Hah - looks like you've got a situation similar to the "I want LINQ syntax, but I'm in 2.0 land", where you could "turn on" LINQ syntax via:

namespace System.Runtime.CompilerServices
{
    [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
    public class ExtensionAttribute : Attribute
    {
    }
}

Only here, you're enabling use of the volatile keyword.

JerKimball
  • 16,584
  • 3
  • 43
  • 55