//**************************************************************************************************
//
// CHECKED OPERATIONS FOR INTEGER TYPE:
//
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// RuntimeForStatic base library | C+- (SysRoutine) | Author: Sergei Y.Kitáev
#pragma once
#include "include_restrictions.h"
namespace RuntimeForStatic {

//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
//
// "$CheckInt" STATIC CLASS:
//
//==================================================================================================
class $CheckInt
{
$STATIC_CLASS( $CheckInt )
public:
   static int Add        ($A, int v1, int v2 ) $fatal_error_on_failure;
   static int Subtract   ($A, int v1, int v2 ) $fatal_error_on_failure;
   static int Multiply   ($A, int v1, int v2 ) $fatal_error_on_failure;
   static int Divide     ($A, int v1, int v2 ) $fatal_error_on_failure;
   static int ChangeSign ($A, int v )          $fatal_error_on_failure;
   static int Double     ($A, int v )          $fatal_error_on_failure;

   static bool TryAdd        ( int* pRes $out $optional, int v1, int v2 );
   static bool TrySubtract   ( int* pRes $out $optional, int v1, int v2 );
   static bool TryMultiply   ( int* pRes $out $optional, int v1, int v2 );
   static bool TryDivide     ( int* pRes $out $optional, int v1, int v2 );
   static bool TryChangeSign ( int* pRes $out $optional, int v );
   static bool TryDouble     ( int* pRes $out $optional, int v );

   static inline bool TryAdd( int v1, int v2 )
   #include "..\inline\CheckInt\TryAdd.impl.h"
   static inline bool TrySubtract( int v1, int v2 )
   #include "..\inline\CheckInt\TrySubtract.impl.h"
   static inline bool TryMultiply( int v1, int v2 )
   #include "..\inline\CheckInt\TryMultiply.impl.h"
   static inline bool TryDivide( int v1, int v2 )
   #include "..\inline\CheckInt\TryDivide.impl.h"
   static inline bool TryChangeSign( int v )
   #include "..\inline\CheckInt\TryChangeSign.impl.h"
   static inline bool TryDouble( int v )
   #include "..\inline\CheckInt\TryDouble.impl.h"
}; // $CheckInt
//==================================================================================================

} // RuntimeForStatic
