//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
// UserRTX.NET satellite library | Author: Sergei Y.Kitáev
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
using System;

#if !WASM
namespace user_rtx { using u = user_rtx;
#else
namespace user_rtx.wasm { using u = user_rtx.wasm;
#endif

static partial class arg_check {
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
const string VN = "value";
//==================================================================================================

/// <exception cref="ArgumentNullException" />
/// <summary>
/// Not-null checking for usage with nullable reference or value
/// </summary>
public static T NN_PV<T>( T? value )
where T: notnull =>
   NN<T>( value, VN );

/// <exception cref="ArgumentException" />
/// <summary>
/// Not-null checking of value-array elements, for usage with array of nullable reference or nullable values
/// </summary>
public static T?[] NotNulls_PV<T>( T?[] values )
where T: notnull =>
   NotNulls<T>( values, VN );

//==================================================================================================

/// <exception cref="ArgumentOutOfRangeException" />
[u.returns_source]
public static T NotZero_PV<T>( T value )
where T: struct, IEquatable<T> =>
   NotZero<T>( value, VN );

/// <exception cref="ArgumentOutOfRangeException" />
[u.returns_source]
public static T NotZeroB_PV<T>( T value )
where T: struct =>
   NotZeroB<T>( value, VN );

//==================================================================================================

/// <exception cref="ArgumentOutOfRangeException" />
[u.returns_source]
public static T NotNegative_PV<T>( T value )
where T: struct, IComparable<T> =>
   NotNegative<T>( value, VN );

/// <exception cref="ArgumentOutOfRangeException" />
[u.returns_source]
public static T Positive_PV<T>( T value )
where T: struct, IComparable<T> =>
   Positive<T>( value, VN );

/// <exception cref="ArgumentOutOfRangeException" />
[u.returns_source]
public static T InRange_PV<T>( T value, T from, T to )
where T: struct, IComparable<T> =>
   InRange<T>( value, from, to, VN );

//==================================================================================================

/// <exception cref="ArgumentOutOfRangeException" />
[u.returns_source]
public static int NotNegative_PV( int value ) =>
   NotNegative( value, VN );

/// <exception cref="ArgumentOutOfRangeException" />
[u.returns_source]
public static int Positive_PV( int value ) =>
   Positive( value, VN );

/// <exception cref="ArgumentOutOfRangeException" />
[u.returns_source]
public static int InRange_PV( int value, int from, int to ) =>
   InRange( value, from, to, VN );

//--------------------------------------------------------------------------------------------------

/// <exception cref="ArgumentOutOfRangeException" />
[u.returns_source]
public static double NotNegative_PV( double value ) =>
   NotNegative( value, VN );

/// <exception cref="ArgumentOutOfRangeException" />
[u.returns_source]
public static double Positive_PV( double value ) =>
   Positive( value, VN );

/// <exception cref="ArgumentOutOfRangeException" />
[u.returns_source]
public static double InRange_PV( double value, double from, double to ) =>
   InRange( value, from, to, VN );

//--------------------------------------------------------------------------------------------------

/// <exception cref="ArgumentOutOfRangeException" />
[u.returns_source]
public static decimal NotNegative_PV( decimal value ) =>
   NotNegative( value, VN );

/// <exception cref="ArgumentOutOfRangeException" />
[u.returns_source]
public static decimal Positive_PV( decimal value ) =>
   Positive( value, VN );

/// <exception cref="ArgumentOutOfRangeException" />
[u.returns_source]
public static decimal InRange_PV( decimal value, decimal from, decimal to ) =>
   InRange( value, from, to, VN );

//--------------------------------------------------------------------------------------------------

/// <exception cref="ArgumentOutOfRangeException" />
[u.returns_source]
public static TimeSpan NotNegative_PV( TimeSpan value ) =>
   NotNegative( value, VN );

/// <exception cref="ArgumentOutOfRangeException" />
[u.returns_source]
public static TimeSpan Positive_PV( TimeSpan value ) =>
   Positive( value, VN );

/// <exception cref="ArgumentOutOfRangeException" />
[u.returns_source]
public static TimeSpan InRange_PV( TimeSpan value, TimeSpan from, TimeSpan to ) =>
   InRange( value, from, to, VN );

//--------------------------------------------------------------------------------------------------

/// <exception cref="ArgumentOutOfRangeException" />
[u.returns_source]
public static DateTime InRange_PV( DateTime value, DateTime from, DateTime to ) =>
   InRange( value, from, to, VN );

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
} // arg_check

} // user_rtx (.wasm)
