.NET Fiddle

CSharp · Console

/Program.cs

using System;

public class C {
	
	public static void Main()
	{		
		  using(var b = new book()){
        }
	}	

    struct book: IDisposable{
        public void Dispose(){
			Console.WriteLine(IsBoxed(this));
		}
    }
	
public static bool IsBoxed<T>(T value)
{
    return 
        (typeof(T).IsInterface || typeof(T) == typeof(object)) &&
        value != null &&
        value.GetType().IsValueType;
}
	
}
;