New IO structure, unexpexted error in C code

This commit is contained in:
Nitload
2023-06-22 03:33:24 +08:00
parent 50b4965e54
commit ee8132c149
172 changed files with 1344 additions and 4023 deletions
+16 -7
View File
@@ -1,11 +1,8 @@
using Microsoft.CSharp;
using System;
using System.Collections.Generic;
using System.Text;
using System;
namespace StgSharp
{
public class Counter<T> where T:struct, IConvertible, IFormattable, IComparable
public class Counter<T> where T : struct, IConvertible, IFormattable, IComparable
{
internal readonly dynamic _defualtValue;
internal readonly dynamic _defualtAddValue;
@@ -19,7 +16,7 @@ namespace StgSharp
set { _value = value; }
}
public Counter(T defualtValue,T defualtAddValue,T defualtSubValue)
public Counter(T defualtValue, T defualtAddValue, T defualtSubValue)
{
var type = Type.GetTypeCode(defualtValue.GetType());
switch (type)
@@ -53,7 +50,7 @@ namespace StgSharp
_defualtSubValue = defualtSubValue;
}
public void Add(T value)
{
_value += value;
@@ -78,5 +75,17 @@ namespace StgSharp
{
_value = _defualtValue;
}
public static Counter<T> operator ++(Counter<T> counter)
{
counter.QuickAdd();
return counter;
}
public static Counter<T> operator --(Counter<T> counter)
{
counter.QuickSub();
return counter;
}
}
}