This commit is contained in:
Nkondog Anselme
2021-11-14 08:19:13 +01:00
parent 0b5d6a5a00
commit ad2fa91937
250 changed files with 213363 additions and 0 deletions
@@ -0,0 +1,26 @@
//+------------------------------------------------------------------+
//| EqualFunction.mqh |
//| Copyright 2016-2017, MetaQuotes Software Corp. |
//| https://www.mql5.com |
//+------------------------------------------------------------------+
#include <Generic\Interfaces\IEqualityComparable.mqh>
//+------------------------------------------------------------------+
//| Indicates whether x object is equal y object of the same type. |
//+------------------------------------------------------------------+
template<typename T>
bool Equals(T x,T y)
{
//--- try to convert to equality comparable object
IEqualityComparable<T>*equtable=dynamic_cast<IEqualityComparable<T>*>(x);
if(equtable)
{
//--- use specied equality compare method
return equtable.Equals(y);
}
else
{
//--- use default equality comparer operator
return(x==y);
}
}
//+------------------------------------------------------------------+