//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
// 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 bitwise {
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

/// <exception cref="ArgumentOutOfRangeException" />
public static int SetBit( ref int location, int bitNo ) =>
   location |= u.int32.Flag( bitNo );

/// <exception cref="ArgumentOutOfRangeException" />
public static long SetBit( ref long location, int bitNo ) =>
   location |= u.int64.Flag( bitNo );

/// <exception cref="ArgumentOutOfRangeException" />
public static short SetBit( ref short location, int bitNo ) =>
   location |= u.int16.Flag( bitNo );

/// <exception cref="ArgumentOutOfRangeException" />
public static byte SetBit( ref byte location, int bitNo ) =>
   location |= u.uint8.Flag( bitNo );

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

/// <exception cref="ArgumentOutOfRangeException" />
[CLSCompliant( false )]
public static uint SetBit( ref uint location, int bitNo ) =>
   location |= u.uint32.Flag( bitNo );

/// <exception cref="ArgumentOutOfRangeException" />
[CLSCompliant( false )]
public static ulong SetBit( ref ulong location, int bitNo ) =>
   location |= u.uint64.Flag( bitNo );

/// <exception cref="ArgumentOutOfRangeException" />
[CLSCompliant( false )]
public static ushort SetBit( ref ushort location, int bitNo ) =>
   location |= u.uint16.Flag( bitNo );

/// <exception cref="ArgumentOutOfRangeException" />
[CLSCompliant( false )]
public static sbyte SetBit( ref sbyte location, int bitNo ) =>
   location |= u.int8.Flag( bitNo );

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
} // bitwise

} // user_rtx (.wasm)
