//**************************************************************************************************
//
// SUBSTITUTIONS (DECLARATION):
//
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// RuntimeForStatic base library | C+- (SysRoutine) | Author: Sergei Y.Kitáev
#pragma once
#include "include_restrictions.h"
namespace RuntimeForStatic {
//==================================================================================================
class $subst { $STATIC_CLASS_PUBLIC( $subst )
//--------------------------------------------------------------------------------------------------

template<typename T>static T NullSubst( T value, T subst );
template<typename T>static T NullSubst( T value,
                                        const std::initializer_list<T>& substitution_list );

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

template<typename T>static T Exchange(T& location,T newValue) $ret_previous;
template<typename T>static T ExchangeR(T& location,const T& newValue) $ret_previous;

template<typename T>static T CompareExchange(T& location,T exchange,T comparand) $ret_initial;
template<typename T>static T CompareExchangeR( T& location,
                                               const T& exchange,
                                               const T& comparand ) $ret_initial;

template<typename T>static T ExchangeAsBool(T& location,bool newValue) $ret_previous;
template<typename T>static T ExchangeAsBoolR(T& location,const bool& newValue) $ret_previous;

template<typename T>static T NullExchange(T& location) $ret_previous;

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

template<typename T>static T ReplaceNull(T& location,T newValue) $ret_target;
template<typename T>static T ReplaceNullR(T& location,const T& newValue) $ret_target;

template<typename T>static T SetIfEqual(T& location,T newValue,T comparand) $ret_target;
template<typename T>static T SetIfEqualR(T& location,const T& newValue,T& comparand) $ret_target;

//--------------------------------------------------------------------------------------------------
}; // $subst
//==================================================================================================
} // RuntimeForStatic
