.NET API 413,656 bytes
Activator<T>
Represents implementation of
ISupplier<T>
that acts as activator of type with public parameterless constructor.
using System.
Runtime.
CompilerServices;
using System.
Runtime.
InteropServices;
namespace DotNext
{
[
StructLayout(
LayoutKind.
Auto)]
public readonly struct Activator<[
System.
Runtime.
CompilerServices.
Nullable(
2)]
T> :
ISupplier<
T>
where T :
new
{
[
System.
Runtime.
CompilerServices.
NullableContext(
1)]
T ISupplier<
T>.
Invoke()
{
return new T();
}
}
}