Index: cpp/frams/_demos/evol_test.cpp
===================================================================
--- cpp/frams/_demos/evol_test.cpp	(revision 1125)
+++ cpp/frams/_demos/evol_test.cpp	(revision 1130)
@@ -1,4 +1,4 @@
 // This file is a part of Framsticks SDK.  http://www.framsticks.com/
-// Copyright (C) 2019-2020  Maciej Komosinski and Szymon Ulatowski.
+// Copyright (C) 2019-2021  Maciej Komosinski and Szymon Ulatowski.
 // See LICENSE.txt for details.
 
@@ -195,5 +195,5 @@
 	for (int i = 0; i < nr_evals; i++)
 	{
-		int selected_positive = tournament(population, max(2, int(sqrt(population.size()) / 2))); //moderate positive selection pressure
+		int selected_positive = tournament(population, std::max(2, int(sqrt(population.size()) / 2))); //moderate positive selection pressure
 		int selected_negative = rndUint(population.size()); //random negative selection
 
@@ -214,5 +214,5 @@
 		else
 		{
-			int selected_positive2 = tournament(population, max(2, int(sqrt(population.size()) / 2)));
+			int selected_positive2 = tournament(population, std::max(2, int(sqrt(population.size()) / 2)));
 			Geno xover = genman.crossOver(population[selected_positive].geno, population[selected_positive2].geno);
 			if (xover.getGenes() == "")
Index: cpp/frams/_demos/printconvmap.cpp
===================================================================
--- cpp/frams/_demos/printconvmap.cpp	(revision 1125)
+++ cpp/frams/_demos/printconvmap.cpp	(revision 1130)
@@ -1,4 +1,4 @@
 // This file is a part of Framsticks SDK.  http://www.framsticks.com/
-// Copyright (C) 1999-2020  Maciej Komosinski and Szymon Ulatowski.
+// Copyright (C) 1999-2021  Maciej Komosinski and Szymon Ulatowski.
 // See LICENSE.txt for details.
 
@@ -88,7 +88,7 @@
 	:model(m)
 {
-	joint_offset = max(10, (int(9 + model.getPartCount()) / 10) * 10);
-	neuron_offset = joint_offset + max(10, (int(9 + model.getJointCount()) / 10) * 10);
-	max_element = neuron_offset + max(10, (int(9 + model.getNeuroCount()) / 10) * 10);
+	joint_offset = std::max(10, (int(9 + model.getPartCount()) / 10) * 10);
+	neuron_offset = joint_offset + std::max(10, (int(9 + model.getJointCount()) / 10) * 10);
+	max_element = neuron_offset + std::max(10, (int(9 + model.getNeuroCount()) / 10) * 10);
 	for (int i = 0; i < model.getPartCount(); i++)
 		map.add(Model::partToMap(i), Model::partToMap(i), i, i);
Index: cpp/frams/canvas/neurodiagram.cpp
===================================================================
--- cpp/frams/canvas/neurodiagram.cpp	(revision 1125)
+++ cpp/frams/canvas/neurodiagram.cpp	(revision 1130)
@@ -1,4 +1,4 @@
 // This file is a part of Framsticks SDK.  http://www.framsticks.com/
-// Copyright (C) 1999-2020  Maciej Komosinski and Szymon Ulatowski.
+// Copyright (C) 1999-2021  Maciej Komosinski and Szymon Ulatowski.
 // See LICENSE.txt for details.
 
@@ -13,4 +13,5 @@
 #include <frams/simul/simul.h>
 #include "common/nonstd_time.h"
+#include <algorithm>
 
 #define FIELDSTRUCT NeuroDiagram
@@ -231,5 +232,5 @@
 	NeuroProbe *probe = new NeuroProbe(getNS(i));
 	Pixel s = getSize();
-	s.x = s.y = max(probe->getSize().x, min(s.x / 3, s.y / 3));
+	s.x = s.y = std::max(probe->getSize().x, std::min(s.x / 3, s.y / 3));
 	probes += (void*)probe;
 	add(probe);
@@ -503,5 +504,5 @@
 				int *dr = drawing;
 				int w = size.x - 2, h = size.y - clienttop - clientbottom;
-				int scale = min(w, h);
+				int scale = std::min(w, h);
 				int x0 = clienttop + leftborder + ((w > h) ? (w - h) / 2 : 0);
 				int y0 = clientleft + topborder + ((h > w) ? (h - w) / 2 : 0);
Index: cpp/frams/canvas/nn_smart_layout.cpp
===================================================================
--- cpp/frams/canvas/nn_smart_layout.cpp	(revision 1125)
+++ cpp/frams/canvas/nn_smart_layout.cpp	(revision 1130)
@@ -1,9 +1,9 @@
 // This file is a part of Framsticks SDK.  http://www.framsticks.com/
-// Copyright (C) 1999-2015  Maciej Komosinski and Szymon Ulatowski.
+// Copyright (C) 1999-2021  Maciej Komosinski and Szymon Ulatowski.
 // See LICENSE.txt for details.
 
 #include "nn_layout.h"
 #include <vector>
-#include "common/nonstd_stl.h"
+#include <algorithm>
 #ifdef __BORLANDC__
  #include <alloc.h> //borland needs for alloc/free
@@ -131,9 +131,9 @@
 	   */
 	int x1, y1, x2, y2; // union rectangle
-	x1 = max(0, b2->minx - b->minx + dx);
-	x2 = min(b->maxx - b->minx, -b->minx + dx + b2->maxx);
+	x1 = std::max(0, b2->minx - b->minx + dx);
+	x2 = std::min(b->maxx - b->minx, -b->minx + dx + b2->maxx);
 	if (x1 > x2) return 1;
-	y1 = max(0, b2->miny - b->miny + dy);
-	y2 = min(b->maxy - b->miny, -b->miny + dy + b2->maxy);
+	y1 = std::max(0, b2->miny - b->miny + dy);
+	y2 = std::min(b->maxy - b->miny, -b->miny + dy + b2->maxy);
 	if (y1 > y2) return 1;
 	int x, y;
@@ -162,8 +162,8 @@
 		b->dodajelement(e, einfo[e].x + dx, einfo[e].y + dy);
 	}
-	b->minx = min(b->minx, dx + b2->minx);
-	b->miny = min(b->miny, dy + b2->miny);
-	b->maxx = max(b->maxx, dx + b2->maxx);
-	b->maxy = max(b->maxy, dy + b2->maxy);
+	b->minx = std::min(b->minx, dx + b2->minx);
+	b->miny = std::min(b->miny, dy + b2->miny);
+	b->maxx = std::max(b->maxx, dx + b2->maxx);
+	b->maxy = std::max(b->maxy, dy + b2->maxy);
 
 	DB(
Index: cpp/frams/genetics/f1/f1_conv.cpp
===================================================================
--- cpp/frams/genetics/f1/f1_conv.cpp	(revision 1125)
+++ cpp/frams/genetics/f1/f1_conv.cpp	(revision 1130)
@@ -1,8 +1,7 @@
 // This file is a part of Framsticks SDK.  http://www.framsticks.com/
-// Copyright (C) 1999-2018  Maciej Komosinski and Szymon Ulatowski.
+// Copyright (C) 1999-2021  Maciej Komosinski and Szymon Ulatowski.
 // See LICENSE.txt for details.
 
 #include "f1_conv.h"
-#include <common/nonstd_stl.h>
 #include <common/log.h>
 #include <frams/util/multirange.h>
@@ -11,4 +10,5 @@
 #include <ctype.h>
 #include <assert.h>
+#include <algorithm>
 
 //#define v1f1COMPATIBLE //as in ancient Framsticks 1.x
@@ -273,5 +273,5 @@
 int Builder::growJoint(int part1, int part2, Pt3D &angle, GeneProps &c, const char *g)
 {
-	double len = min(2.0, c.length);
+	double len = std::min(2.0, c.length);
 	sprintf(tmp, "p1=%d,p2=%d,dx=%lg,rx=%lg,ry=%lg,rz=%lg,stam=%lg,vr=%g,vg=%g,vb=%g",
 		part1, part2, len, angle.x, angle.y, angle.z, c.stamina, c.cred, c.cgreen, c.cblue);
Index: cpp/frams/genetics/f9/f9_conv.cpp
===================================================================
--- cpp/frams/genetics/f9/f9_conv.cpp	(revision 1125)
+++ cpp/frams/genetics/f9/f9_conv.cpp	(revision 1130)
@@ -1,4 +1,4 @@
 // This file is a part of Framsticks SDK.  http://www.framsticks.com/
-// Copyright (C) 1999-2020  Maciej Komosinski and Szymon Ulatowski.
+// Copyright (C) 1999-2021  Maciej Komosinski and Szymon Ulatowski.
 // See LICENSE.txt for details.
 
@@ -6,5 +6,4 @@
 #include <frams/model/model.h>
 #include <string.h>
-#include <common/nonstd_stl.h> //ARRAY_LENGTH
 
 #define APPLY_DETERMINISTIC_BODY_NOISE //this genetic representation easily produces perfectly vertical sticks that would stay upright forever in simulation. In most cases such infinite perfection is not desired, so we make the construct less perfect by perturbing its coordinates.
@@ -129,5 +128,5 @@
 	static int g[] = { 0, 1, 1, 1, 0, 0 };
 	static int b[] = { 0, 0, 0, 1, 1, 1 };
-	int maxind = ARRAY_LENGTH(r) - 1;
+	int maxind = int(std::size(r)) - 1;
 
 	int joints_count = m.getJointCount();
Index: cpp/frams/genetics/fB/fB_conv.cpp
===================================================================
--- cpp/frams/genetics/fB/fB_conv.cpp	(revision 1125)
+++ cpp/frams/genetics/fB/fB_conv.cpp	(revision 1130)
@@ -1,4 +1,4 @@
 // This file is a part of Framsticks SDK.  http://www.framsticks.com/
-// Copyright (C) 1999-2020  Maciej Komosinski and Szymon Ulatowski.
+// Copyright (C) 1999-2021  Maciej Komosinski and Szymon Ulatowski.
 // See LICENSE.txt for details.
 
@@ -7,4 +7,5 @@
 #include <frams/param/paramobj.h>
 #include <vector>
+#include <algorithm>
 #include <frams/util/multimap.h>
 #include "fB_general.h"
@@ -250,5 +251,5 @@
 				double mn, mx, def;
 				par.getMinMaxDouble(propindex, mn, mx, def);
-				par.setDouble(propindex, min(mx, max(mn, (mx - mn) * val + mn)));
+				par.setDouble(propindex, std::min(mx, std::max(mn, (mx - mn) * val + mn)));
 			}
 			propindex++;
Index: cpp/frams/genetics/fB/fB_oper.cpp
===================================================================
--- cpp/frams/genetics/fB/fB_oper.cpp	(revision 1125)
+++ cpp/frams/genetics/fB/fB_oper.cpp	(revision 1130)
@@ -1,8 +1,9 @@
 // This file is a part of Framsticks SDK.  http://www.framsticks.com/
-// Copyright (C) 1999-2020  Maciej Komosinski and Szymon Ulatowski.
+// Copyright (C) 1999-2021  Maciej Komosinski and Szymon Ulatowski.
 // See LICENSE.txt for details.
 
 #include <frams/util/sstring.h>
 #include <vector>
+#include <algorithm>
 #include <frams/param/param.h>
 #include "fB_conv.h"
@@ -461,5 +462,5 @@
 	{
 		// get maximal count of genes from both parents
-		int maxgenecount = max(fB_GenoHelpers::geneCountNoNested(parent1),
+		int maxgenecount = std::max(fB_GenoHelpers::geneCountNoNested(parent1),
 			fB_GenoHelpers::geneCountNoNested(parent2));
 
Index: cpp/frams/genetics/fF/fF_conv.cpp
===================================================================
--- cpp/frams/genetics/fF/fF_conv.cpp	(revision 1125)
+++ cpp/frams/genetics/fF/fF_conv.cpp	(revision 1130)
@@ -1,9 +1,8 @@
 // This file is a part of Framsticks SDK.  http://www.framsticks.com/
-// Copyright (C) 1999-2020  Maciej Komosinski and Szymon Ulatowski.
+// Copyright (C) 1999-2021  Maciej Komosinski and Szymon Ulatowski.
 // See LICENSE.txt for details.
 
 #include "fF_conv.h"
 #include "fF_genotype.h"
-#include <common/nonstd_stl.h>
 #include <common/Convert.h>
 
Index: cpp/frams/genetics/fF/fF_oper.cpp
===================================================================
--- cpp/frams/genetics/fF/fF_oper.cpp	(revision 1125)
+++ cpp/frams/genetics/fF/fF_oper.cpp	(revision 1130)
@@ -1,4 +1,4 @@
 // This file is a part of Framsticks SDK.  http://www.framsticks.com/
-// Copyright (C) 1999-2020  Maciej Komosinski and Szymon Ulatowski.
+// Copyright (C) 1999-2021  Maciej Komosinski and Szymon Ulatowski.
 // See LICENSE.txt for details.
 
@@ -49,5 +49,5 @@
 	par.load(gene);
 	static const int propsToMutate[] = fF_PROPS_TO_MUTATE;
-	int which = rndUint(ARRAY_LENGTH(propsToMutate));
+	int which = rndUint(std::size(propsToMutate));
 	bool mutated_ok = GenoOperators::mutatePropertyNaive(par.param, propsToMutate[which]);
 	if (mutated_ok)
Index: cpp/frams/genetics/fS/fS_general.cpp
===================================================================
--- cpp/frams/genetics/fS/fS_general.cpp	(revision 1125)
+++ cpp/frams/genetics/fS/fS_general.cpp	(revision 1130)
@@ -1,4 +1,4 @@
 // This file is a part of Framsticks SDK.  http://www.framsticks.com/
-// Copyright (C) 2019-2020  Maciej Komosinski and Szymon Ulatowski.
+// Copyright (C) 2019-2021  Maciej Komosinski and Szymon Ulatowski.
 // See LICENSE.txt for details.
 
@@ -13,4 +13,5 @@
 #include "common/nonstd_math.h"
 #include <frams/model/geometry/part_distance_estimator.h>
+#include <algorithm>
 
 int fS_Genotype::precision = 4;
Index: cpp/frams/genetics/fS/fS_oper.cpp
===================================================================
--- cpp/frams/genetics/fS/fS_oper.cpp	(revision 1125)
+++ cpp/frams/genetics/fS/fS_oper.cpp	(revision 1130)
@@ -1,4 +1,4 @@
 // This file is a part of Framsticks SDK.  http://www.framsticks.com/
-// Copyright (C) 2019-2020  Maciej Komosinski and Szymon Ulatowski.
+// Copyright (C) 2019-2021  Maciej Komosinski and Szymon Ulatowski.
 // See LICENSE.txt for details.
 
@@ -7,4 +7,5 @@
 #include "fS_oper.h"
 #include "frams/util/rndutil.h"
+#include <algorithm>
 
 #define FIELDSTRUCT GenoOper_fS
@@ -362,5 +363,5 @@
 			{
 				// Remove the selected child
-				swap(randomNode->children[selectedIndex], randomNode->children[childCount - 1]);
+				std::swap(randomNode->children[selectedIndex], randomNode->children[childCount - 1]);
 				randomNode->children.pop_back();
 				randomNode->children.shrink_to_fit();
@@ -586,5 +587,5 @@
 			fS_Neuron *it = randomNode->neurons[rndUint(size)];
 			geno.rearrangeNeuronConnections(it, SHIFT::LEFT);        // Important to rearrange the neurons before deleting
-			swap(it, randomNode->neurons.back());
+			std::swap(it, randomNode->neurons.back());
 			randomNode->neurons.pop_back();
 			randomNode->neurons.shrink_to_fit();
Index: cpp/frams/genetics/fn/fn_conv.h
===================================================================
--- cpp/frams/genetics/fn/fn_conv.h	(revision 1125)
+++ cpp/frams/genetics/fn/fn_conv.h	(revision 1130)
@@ -1,4 +1,4 @@
 // This file is a part of Framsticks SDK.  http://www.framsticks.com/
-// Copyright (C) 1999-2018  Maciej Komosinski and Szymon Ulatowski.
+// Copyright (C) 1999-2021  Maciej Komosinski and Szymon Ulatowski.
 // See LICENSE.txt for details.
 
@@ -7,4 +7,5 @@
 
 #include <frams/genetics/genoconv.h>
+#include <common/nonstd_stl.h>
 
 // The fn->f0 converter
Index: cpp/frams/genetics/geneprops.cpp
===================================================================
--- cpp/frams/genetics/geneprops.cpp	(revision 1125)
+++ cpp/frams/genetics/geneprops.cpp	(revision 1130)
@@ -1,7 +1,8 @@
 // This file is a part of Framsticks SDK.  http://www.framsticks.com/
-// Copyright (C) 1999-2018  Maciej Komosinski and Szymon Ulatowski.
+// Copyright (C) 1999-2021  Maciej Komosinski and Szymon Ulatowski.
 // See LICENSE.txt for details.
 
 #include "geneprops.h"
+#include <algorithm>
 
 GeneProps GeneProps::standard_values;
@@ -54,11 +55,11 @@
 #ifdef v1f1COMPATIBLE
 	case 'L': length += (3.0 - length)*0.3;
-		length = min(length, Model::getMaxJoint().d.x); break;
+		length = std::min(length, Model::getMaxJoint().d.x); break;
 #else
 	case 'L': length += (2.0 - length)*0.3; //2.0 is currently Model::getMaxJoint().d.x so min() does not limit the range
-		length = min(length, Model::getMaxJoint().d.x); break;
+		length = std::min(length, Model::getMaxJoint().d.x); break;
 #endif
 	case 'l': length += (0.33 - length)*0.3;
-		length = max(length, Model::getMinJoint().d.x); break;
+		length = std::max(length, Model::getMinJoint().d.x); break;
 
 	case 'W': weight += (2.0 - weight)*0.3;  break;
Index: cpp/frams/model/autoname.cpp
===================================================================
--- cpp/frams/model/autoname.cpp	(revision 1125)
+++ cpp/frams/model/autoname.cpp	(revision 1130)
@@ -1,8 +1,8 @@
 // This file is a part of Framsticks SDK.  http://www.framsticks.com/
-// Copyright (C) 1999-2020  Maciej Komosinski and Szymon Ulatowski.
+// Copyright (C) 1999-2021  Maciej Komosinski and Szymon Ulatowski.
 // See LICENSE.txt for details.
 
 #include "autoname.h"
-#include "common/nonstd_stl.h"
+#include <algorithm>
 #include <ctype.h>
 
@@ -100,5 +100,5 @@
 	if (model.getPartCount() > 0)
 	{
-		cialo = min((int)(sqrt(double(model.getPartCount()) - 1) * NAME_BODYLEN), NAME_MAXLENBODY - 1);
+		cialo = std::min((int)(sqrt(double(model.getPartCount()) - 1) * NAME_BODYLEN), NAME_MAXLENBODY - 1);
 		poz = 0;
 		for (i = 0; i <= cialo; i++) // budowanie "opisu" ciala
@@ -106,6 +106,6 @@
 			nextpoz = ((model.getPartCount()) * (i + 1)) / (cialo + 1) - 1;
 			w = 1.0;
-			for (; poz <= nextpoz; poz++) w = max(w, model.getPart(poz)->mass);
-			tmpc[i] = Sp[min(int((w - 1.0) * NAME_BODYMASS), int(sizeof(Sp)) - 2)];
+			for (; poz <= nextpoz; poz++) w = std::max(w, model.getPart(poz)->mass);
+			tmpc[i] = Sp[std::min(int((w - 1.0) * NAME_BODYMASS), int(sizeof(Sp)) - 2)];
 		}
 		tmpc[i] = 0;
@@ -117,5 +117,5 @@
 	if (model.getNeuroCount() > 0)
 	{
-		mozg = min((int)(sqrt((double)model.getNeuroCount()) * NAME_BRAINLEN), NAME_MAXLENBRAIN - 1);
+		mozg = std::min((int)(sqrt((double)model.getNeuroCount()) * NAME_BRAINLEN), NAME_MAXLENBRAIN - 1);
 		poz = 0;
 		for (i = 0; i <= mozg; i++) // budowanie "opisu" mozgu
@@ -123,6 +123,6 @@
 			nextpoz = (model.getNeuroCount() * (i + 1)) / (mozg + 1) - 1;
 			wint = 0;
-			for (; poz <= nextpoz; poz++) wint = max(wint, model.getNeuro(poz)->getInputCount());
-			tmpm[i] = Sam[min(int(wint * NAME_BRAININP), int(sizeof(Sam)) - 2)];
+			for (; poz <= nextpoz; poz++) wint = std::max(wint, model.getNeuro(poz)->getInputCount());
+			tmpm[i] = Sam[std::min(int(wint * NAME_BRAININP), int(sizeof(Sam)) - 2)];
 		}
 		tmpm[i] = 0;
Index: cpp/frams/model/model.h
===================================================================
--- cpp/frams/model/model.h	(revision 1125)
+++ cpp/frams/model/model.h	(revision 1130)
@@ -13,4 +13,5 @@
 #include <frams/util/advlist.h>
 #include <frams/util/usertags.h>
+#include <common/nonstd_stl.h>
 
 extern ParamEntry f0_model_paramtab[];
Index: cpp/frams/model/similarity/EMD/emd.c
===================================================================
--- cpp/frams/model/similarity/EMD/emd.c	(revision 1125)
+++ cpp/frams/model/similarity/EMD/emd.c	(revision 1130)
@@ -19,4 +19,5 @@
 #include <stdlib.h>
 #include <math.h>
+#include <algorithm>
 
 #include "emd.h"
@@ -100,5 +101,5 @@
 {
   int itr;
-  int max_n = max(_n1, _n2); //max_n was introduced in r1062 instead of the #defined constant MAX_SIG_SIZE1=1000 in the original implementation. max_n is better than the constant, but it would be even better to use either _n1 or _n2, if we only knew what size each individual array should precisely have.
+  int max_n = std::max(_n1, _n2); //max_n was introduced in r1062 instead of the #defined constant MAX_SIG_SIZE1=1000 in the original implementation. max_n is better than the constant, but it would be even better to use either _n1 or _n2, if we only knew what size each individual array should precisely have.
   double totalCost;
   float w;
@@ -211,5 +212,5 @@
 {
   int i, j;
-  int max_n = max(_n1, _n2); //max_n was introduced in r1062 instead of the #defined constant MAX_SIG_SIZE1=1000 in the original implementation. max_n is better than the constant, but it would be even better to use either _n1 or _n2, if we only knew what size each individual array should precisely have.
+  int max_n = std::max(_n1, _n2); //max_n was introduced in r1062 instead of the #defined constant MAX_SIG_SIZE1=1000 in the original implementation. max_n is better than the constant, but it would be even better to use either _n1 or _n2, if we only knew what size each individual array should precisely have.
   double sSum, dSum, diff;
   feature_t *P1, *P2;
@@ -474,5 +475,5 @@
 {
     int i, j, k;
-    int max_n = max(_n1, _n2); //max_n was introduced in r1062 instead of the #defined constant MAX_SIG_SIZE1=1000 in the original implementation. max_n is better than the constant, but it would be even better to use either _n1 or _n2, if we only knew what size each individual array should precisely have.
+    int max_n = std::max(_n1, _n2); //max_n was introduced in r1062 instead of the #defined constant MAX_SIG_SIZE1=1000 in the original implementation. max_n is better than the constant, but it would be even better to use either _n1 or _n2, if we only knew what size each individual array should precisely have.
     double xMin;
     int steps;
@@ -555,5 +556,5 @@
 {
   int i, steps;
-  int max_n = max(_n1, _n2); //max_n was introduced in r1062 instead of the #defined constant MAX_SIG_SIZE1=1000 in the original implementation. max_n is better than the constant, but it would be even better to use either _n1 or _n2, if we only knew what size each individual array should precisely have.
+  int max_n = std::max(_n1, _n2); //max_n was introduced in r1062 instead of the #defined constant MAX_SIG_SIZE1=1000 in the original implementation. max_n is better than the constant, but it would be even better to use either _n1 or _n2, if we only knew what size each individual array should precisely have.
   node2_t **CurX, *NewX;
   char *IsUsed=new char[2*max_n]; 
@@ -652,5 +653,5 @@
 {
   int i, j, found, minI, minJ;
-  int max_n = max(_n1, _n2); //max_n was introduced in r1062 instead of the #defined constant MAX_SIG_SIZE1=1000 in the original implementation. max_n is better than the constant, but it would be even better to use either _n1 or _n2, if we only knew what size each individual array should precisely have.
+  int max_n = std::max(_n1, _n2); //max_n was introduced in r1062 instead of the #defined constant MAX_SIG_SIZE1=1000 in the original implementation. max_n is better than the constant, but it would be even better to use either _n1 or _n2, if we only knew what size each individual array should precisely have.
   double deltaMin, oldVal, diff;
   double** Delta = new double*[_n1];
Index: cpp/frams/model/similarity/measure-distribution.cpp
===================================================================
--- cpp/frams/model/similarity/measure-distribution.cpp	(revision 1125)
+++ cpp/frams/model/similarity/measure-distribution.cpp	(revision 1130)
@@ -79,5 +79,5 @@
 	//int size = sampled.getPartCount();
 	//if (size < (int) sqrt((double) std::numeric_limits<int>::max())) //prevent exceeding int limits
-	//	samples_taken = min(samples_num, size*size);
+	//	samples_taken = std::min(samples_num, size*size);
 
 	rndgen.seed(55); //For determinism. Otherwise the descriptors (that choose samples pseudo-randomly) for the same Model can yield different values and so the dissimilarity between the object and its copy will not be 0.
Index: cpp/frams/neuro/impl/neuroimpl-channels.cpp
===================================================================
--- cpp/frams/neuro/impl/neuroimpl-channels.cpp	(revision 1125)
+++ cpp/frams/neuro/impl/neuroimpl-channels.cpp	(revision 1130)
@@ -1,8 +1,8 @@
 // This file is a part of Framsticks SDK.  http://www.framsticks.com/
-// Copyright (C) 1999-2015  Maciej Komosinski and Szymon Ulatowski.
+// Copyright (C) 1999-2021  Maciej Komosinski and Szymon Ulatowski.
 // See LICENSE.txt for details.
 
 #include "neuroimpl-channels.h"
-#include <common/nonstd_stl.h>
+#include <algorithm>
 
 void NI_Channelize::go()
@@ -18,7 +18,7 @@
 	if (c < 2) { setState(getWeightedInputState(1)); return; }
 	double s = getWeightedInputState(0);
-	s = (max(-1.0, min(1.0, s)) + 1.0) / 2.0; // 0..1
+	s = (std::max(-1.0, std::min(1.0, s)) + 1.0) / 2.0; // 0..1
 	int i1;
-	i1 = (int)(s * (c - 1)); i1 = max(0, min(i1, c - 2));
+	i1 = (int)(s * (c - 1)); i1 = std::max(0, std::min(i1, c - 2));
 	double sw = 1.0 / (c - 1);
 	double s1 = sw * i1;
Index: cpp/frams/neuro/impl/neuroimpl-fuzzy-f0.cpp
===================================================================
--- cpp/frams/neuro/impl/neuroimpl-fuzzy-f0.cpp	(revision 1125)
+++ cpp/frams/neuro/impl/neuroimpl-fuzzy-f0.cpp	(revision 1130)
@@ -1,4 +1,4 @@
 // This file is a part of Framsticks SDK.  http://www.framsticks.com/
-// Copyright (C) 1999-2020  Maciej Komosinski and Szymon Ulatowski.
+// Copyright (C) 1999-2021  Maciej Komosinski and Szymon Ulatowski.
 // See LICENSE.txt for details.
 
@@ -7,5 +7,5 @@
 
 #include "neuroimpl-fuzzy-f0.h"
-#include <common/nonstd_stl.h> //min,max
+#include <algorithm>
 
 //this part concerns fuzzy sets transformation
@@ -132,5 +132,5 @@
 				return -1;
 			if ((k >= inNr) && ((k % 2) == 0))
-				maxOutputNr = max(maxOutputNr, rules[j][k]);
+				maxOutputNr = std::max(maxOutputNr, rules[j][k]);
 		}
 	}
Index: cpp/frams/neuro/impl/neuroimpl-fuzzy.cpp
===================================================================
--- cpp/frams/neuro/impl/neuroimpl-fuzzy.cpp	(revision 1125)
+++ cpp/frams/neuro/impl/neuroimpl-fuzzy.cpp	(revision 1130)
@@ -1,9 +1,8 @@
 // This file is a part of Framsticks SDK.  http://www.framsticks.com/
-// Copyright (C) 1999-2020  Maciej Komosinski and Szymon Ulatowski.
+// Copyright (C) 1999-2021  Maciej Komosinski and Szymon Ulatowski.
 // See LICENSE.txt for details.
 
 #include "neuroimpl-fuzzy.h"
 #include "neuroimpl-fuzzy-f0.h"
-#include <common/nonstd_stl.h> //min,max
 
 int NI_FuzzyNeuro::countOuts(const Model *m, const Neuro *fuzzy)
@@ -109,5 +108,5 @@
 			nrFuzzySet = rules[i][j * 2 + 1]; // j*2 moves pointer through each output, +1 moves to nr of fuzzy set
 			inputNr = rules[i][j * 2]; // as above but gives input number
-			minimumCut = min(minimumCut, TrapeziumFuzz(nrFuzzySet, getWeightedInputState(inputNr))); // value of membership function for this input and given fuzzy set
+			minimumCut = std::min(minimumCut, TrapeziumFuzz(nrFuzzySet, getWeightedInputState(inputNr))); // value of membership function for this input and given fuzzy set
 		}
 		if ((minimumCut > 1) || (minimumCut < 0))
Index: cpp/frams/param/mutableparam.cpp
===================================================================
--- cpp/frams/param/mutableparam.cpp	(revision 1125)
+++ cpp/frams/param/mutableparam.cpp	(revision 1130)
@@ -1,4 +1,4 @@
 // This file is a part of Framsticks SDK.  http://www.framsticks.com/
-// Copyright (C) 1999-2020  Maciej Komosinski and Szymon Ulatowski.
+// Copyright (C) 1999-2021  Maciej Komosinski and Szymon Ulatowski.
 // See LICENSE.txt for details.
 
@@ -22,5 +22,5 @@
 };
 #undef FIELDSTRUCT
-const int MutableParam::staticprops = ARRAY_LENGTH(pe_tab);
+const int MutableParam::staticprops = std::size(pe_tab);
 
 MutableParam::MutableParam(const char*n, const char*g, int gr0)
Index: cpp/frams/param/paramobj.cpp
===================================================================
--- cpp/frams/param/paramobj.cpp	(revision 1125)
+++ cpp/frams/param/paramobj.cpp	(revision 1130)
@@ -1,9 +1,9 @@
 // This file is a part of Framsticks SDK.  http://www.framsticks.com/
-// Copyright (C) 1999-2020  Maciej Komosinski and Szymon Ulatowski.
+// Copyright (C) 1999-2021  Maciej Komosinski and Szymon Ulatowski.
 // See LICENSE.txt for details.
 
 #include <frams/param/paramobj.h>
 #include <frams/util/extvalue.h>
-#include <common/nonstd_stl.h>
+#include <algorithm>
 	
 static const char* maybedup(bool dup, const char* src)
@@ -232,5 +232,5 @@
 	const ExtValue *s = &src.fields[0];
 	ExtValue *d = &fields[0];
-	int n = min(numfields, src.numfields);
+	int n = std::min(numfields, src.numfields);
 	for (int i = 0; i < n; i++, d++, s++)
 		*d = *s;
Index: cpp/frams/util/extvalue.h
===================================================================
--- cpp/frams/util/extvalue.h	(revision 1125)
+++ cpp/frams/util/extvalue.h	(revision 1130)
@@ -1,4 +1,4 @@
 // This file is a part of Framsticks SDK.  http://www.framsticks.com/
-// Copyright (C) 1999-2015  Maciej Komosinski and Szymon Ulatowski.
+// Copyright (C) 1999-2021  Maciej Komosinski and Szymon Ulatowski.
 // See LICENSE.txt for details.
 
@@ -8,6 +8,6 @@
 #include "sstring.h"
 #include <frams/param/param.h>
-#include <common/nonstd_stl.h>
 #include <common/threads.h>
+#include <vector>
 
 #define EXTVALUEUNION
Index: cpp/frams/util/multirange.cpp
===================================================================
--- cpp/frams/util/multirange.cpp	(revision 1125)
+++ cpp/frams/util/multirange.cpp	(revision 1130)
@@ -1,8 +1,8 @@
 // This file is a part of Framsticks SDK.  http://www.framsticks.com/
-// Copyright (C) 1999-2015  Maciej Komosinski and Szymon Ulatowski.
+// Copyright (C) 1999-2021  Maciej Komosinski and Szymon Ulatowski.
 // See LICENSE.txt for details.
 
 #include "multirange.h"
-#include <common/nonstd_stl.h>
+#include <algorithm>
 
 #include <stdio.h>
@@ -230,5 +230,5 @@
 		break;
 	case SAME + JOINBEGIN: // extend 1 range
-		setEnd(r1, max(getEnd(r2), end));
+		setEnd(r1, std::max(getEnd(r2), end));
 		break;
 	case SAME + JOINEND: // extend 1 range
@@ -244,5 +244,5 @@
 		break;
 	case JOINBEGIN: // extend r1
-		setEnd(r1, max(end, getEnd(r2)));
+		setEnd(r1, std::max(end, getEnd(r2)));
 		removeRanges(r1 + 1, r2);
 		break;
@@ -253,5 +253,5 @@
 	case 0: // extend r2
 		setBegin(r2, begin);
-		setEnd(r2, max(end, getEnd(r2)));
+		setEnd(r2, std::max(end, getEnd(r2)));
 		removeRanges(r1 + 1, r2 - 1);
 		break;
Index: cpp/frams/util/sstring-simple.cpp
===================================================================
--- cpp/frams/util/sstring-simple.cpp	(revision 1125)
+++ cpp/frams/util/sstring-simple.cpp	(revision 1130)
@@ -1,4 +1,3 @@
 #include "sstring.h"
-#include <common/nonstd_stl.h>
 #include "extvalue.h"
 #include <assert.h>
Index: cpp/frams/util/sstring.cpp
===================================================================
--- cpp/frams/util/sstring.cpp	(revision 1125)
+++ cpp/frams/util/sstring.cpp	(revision 1130)
@@ -20,5 +20,4 @@
 // - mutex required to be thread safe
 
-#include <common/nonstd_stl.h>
 #include "extvalue.h"
 #include <assert.h>
Index: cpp/frams/vm/classes/collectionobj.cpp
===================================================================
--- cpp/frams/vm/classes/collectionobj.cpp	(revision 1125)
+++ cpp/frams/vm/classes/collectionobj.cpp	(revision 1130)
@@ -1,4 +1,4 @@
 // This file is a part of Framsticks SDK.  http://www.framsticks.com/
-// Copyright (C) 1999-2020  Maciej Komosinski and Szymon Ulatowski.
+// Copyright (C) 1999-2021  Maciej Komosinski and Szymon Ulatowski.
 // See LICENSE.txt for details.
 
@@ -6,5 +6,5 @@
 #include <common/nonstd_math.h> //sqrt in borland
 #include <frams/util/validitychecks.h>
-#include <common/nonstd_stl.h>
+#include <algorithm>
 #include <frams/util/sstringutils.h>
 #ifndef NO_VMACHINE
@@ -228,5 +228,5 @@
 		s += d * d;
 	}
-	ret->setDouble(sqrt(s / max(1, data.size() - 1)));
+	ret->setDouble(sqrt(s / std::max(1, data.size() - 1)));
 }
 
