From b7fc72de0f487c1cc9bab10aa9bda302e480aa63 Mon Sep 17 00:00:00 2001 From: Adrian Kierzkowski Date: Tue, 27 Sep 2022 18:20:39 +0200 Subject: [PATCH 1/2] Should fix problem "'array' - constant variable cannot be passed as reference" in Array.mqh. --- Array.mqh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Array.mqh b/Array.mqh index d71b044d0..5fe88d897 100644 --- a/Array.mqh +++ b/Array.mqh @@ -753,7 +753,7 @@ static int GetLowestArrDoubleValue(double& arr[][], int key) { * - https://www.mql5.com/en/docs/array/arraysize */ template - static int ArraySize(const ARRAY_REF(X, array)) { + static int ArraySize(ARRAY_REF(X, array)) { return ::ArraySize(array); } @@ -769,7 +769,7 @@ static int GetLowestArrDoubleValue(double& arr[][], int key) { template void ArrayPush(ARRAY_REF(X, array), X value) { - ArrayResize(ArraySize(array) + 1); + ArrayResize(Array::ArraySize(array) + 1); array[ArraySize(array) - 1] = value; } template From 5c1d8aecb368bc6b16dc42446d077c697f4b838b Mon Sep 17 00:00:00 2001 From: Adrian Kierzkowski Date: Wed, 30 Nov 2022 13:38:41 +0100 Subject: [PATCH 2/2] Fixes C++ const-related errors. --- Array.mqh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Array.mqh b/Array.mqh index 5fe88d897..d84c33d4b 100644 --- a/Array.mqh +++ b/Array.mqh @@ -691,7 +691,7 @@ static int GetLowestArrDoubleValue(double& arr[][], int key) { * - https://www.mql5.com/en/docs/array/arraymaximum */ template - static int ArrayMinimum(const ARRAY_REF(X, _array), int _start = 0, int _count = WHOLE_ARRAY) { + static int ArrayMinimum(ARRAY_REF(X, _array), int _start = 0, int _count = WHOLE_ARRAY) { #ifdef __MQL__ return ::ArrayMinimum(_array); #else @@ -724,7 +724,7 @@ static int GetLowestArrDoubleValue(double& arr[][], int key) { * - https://www.mql5.com/en/docs/array/arraymaximum */ template - static int ArrayMaximum(const ARRAY_REF(X, _array), int start = 0, int count = WHOLE_ARRAY) { + static int ArrayMaximum(ARRAY_REF(X, _array), int start = 0, int count = WHOLE_ARRAY) { #ifdef __MQL__ return ::ArrayMaximum(_array); #else