Index: cpp/frams/genetics/f1/f1_conv.cpp
===================================================================
--- cpp/frams/genetics/f1/f1_conv.cpp	(revision 1108)
+++ 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 1108)
+++ 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 1108)
+++ 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 1108)
+++ 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 1108)
+++ 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 1108)
+++ 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 1108)
+++ 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 1108)
+++ 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 1108)
+++ 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 1108)
+++ 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;
