diff --git a/mex/sources/bytecode/Interpreter.cc b/mex/sources/bytecode/Interpreter.cc
index 5fc1ef0bc61b7522d0308ad9e5dd2c858765ce09..9869a3a7819345f8fe50870599e825ffb85a8db6 100644
--- a/mex/sources/bytecode/Interpreter.cc
+++ b/mex/sources/bytecode/Interpreter.cc
@@ -520,7 +520,7 @@ Interpreter::simulate_a_block(
       mxFree(u);
       mxFree(index_equa);
       mxFree(index_vara);
-      fill_n(direction, y_size * col_y, 0);
+      ranges::fill_n(direction, y_size * col_y, 0);
       End_Solver();
       break;
     case BlockSimulationType::solveBackwardComplete:
@@ -541,7 +541,7 @@ Interpreter::simulate_a_block(
 
       mxFree(index_equa);
       mxFree(index_vara);
-      fill_n(direction, y_size * col_y, 0);
+      ranges::fill_n(direction, y_size * col_y, 0);
       mxFree(u);
       End_Solver();
       break;
@@ -642,7 +642,7 @@ Interpreter::simulate_a_block(
         mxFree(index_equa);
       if (res)
         mxFree(res);
-      fill_n(direction, y_size * col_y, 0);
+      ranges::fill_n(direction, y_size * col_y, 0);
       End_Solver();
       break;
     default:
@@ -2560,7 +2560,7 @@ Interpreter::Sparse_transpose(const mxArray* A_m)
   mwIndex* C_j = mxGetJc(C_m);
   double* C_d = mxGetPr(C_m);
   unsigned int nze_C = 0, nze_A = 0;
-  fill_n(C_j, m_A + 1, 0);
+  ranges::fill_n(C_j, m_A + 1, 0);
   map<pair<mwIndex, unsigned int>, double> B2;
   for (unsigned int i = 0; i < n_A; i++)
     while (nze_A < static_cast<unsigned int>(A_j[i + 1]))
@@ -4786,6 +4786,6 @@ Interpreter::fixe_u()
 #ifdef DEBUG
   mexPrintf("u=%d\n", u);
 #endif
-  fill_n(u, u_count_alloc, 0);
+  ranges::fill_n(u, u_count_alloc, 0);
   u_count_init = u_count_int;
 }
diff --git a/mex/sources/bytecode/bytecode.cc b/mex/sources/bytecode/bytecode.cc
index b11efc99b6771d1c3bbfb9a6a5fc6f1364e69079..3c7c78c7d3634666ab5389ff950171118acff0f3 100644
--- a/mex/sources/bytecode/bytecode.cc
+++ b/mex/sources/bytecode/bytecode.cc
@@ -518,7 +518,7 @@ mexFunction(int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[])
   auto* x = static_cast<double*>(mxMalloc(col_x * row_x * sizeof(double)));
   test_mxMalloc(x, __LINE__, __FILE__, __func__, col_x * row_x * sizeof(double));
 
-  fill_n(direction, row_y * col_y, 0);
+  ranges::fill_n(direction, row_y * col_y, 0);
   ranges::copy_n(xd, row_x * col_x, x);
   ranges::copy_n(yd, row_y * col_y, y);
   ranges::copy_n(yd, row_y * col_y, ya);
diff --git a/mex/sources/libkorder/sylv/Vector.cc b/mex/sources/libkorder/sylv/Vector.cc
index 9dad003dbdf9a9ee7054c289311ff6b4f4fdc99e..1123c40fdcd7aad8c9e9a8aa2310bfa0ec455c8d 100644
--- a/mex/sources/libkorder/sylv/Vector.cc
+++ b/mex/sources/libkorder/sylv/Vector.cc
@@ -118,7 +118,7 @@ void
 Vector::zeros()
 {
   if (s == 1)
-    std::fill_n(data, len, 0.0);
+    std::ranges::fill_n(data, len, 0.0);
   else
     for (int i = 0; i < len; i++)
       operator[](i) = 0.0;
diff --git a/mex/sources/libkorder/tl/int_sequence.hh b/mex/sources/libkorder/tl/int_sequence.hh
index 3c0d0be8d6030dd44610d2d3b2d5a2a314c1cb6c..618addf5e222d539b2015ce40da2e03bbeaae60c 100644
--- a/mex/sources/libkorder/tl/int_sequence.hh
+++ b/mex/sources/libkorder/tl/int_sequence.hh
@@ -72,7 +72,7 @@ public:
   // Constructor allocating and then initializing all members to a given number
   IntSequence(int l, int n) : data {new int[l]}, length {l}
   {
-    std::fill_n(data, length, n);
+    std::ranges::fill_n(data, length, n);
   }
   /* Constructor using an initializer list (gives the contents of the
      IntSequence, similarly to std::vector) */