diff --git a/pystencils/cpu/cpujit.py b/pystencils/cpu/cpujit.py
index 84908dcb29b38fc89a1b381d1491fbde59a09db7..f5f8f63c1b2058614f4553b4146017b6fa362145 100644
--- a/pystencils/cpu/cpujit.py
+++ b/pystencils/cpu/cpujit.py
@@ -160,7 +160,7 @@ def read_config():
             ('msvc_version', 'latest'),
             ('llc_command', get_llc_command() or 'llc'),
             ('arch', 'x64'),
-            ('flags', '/Ox /fp:fast /OpenMP /arch:avx'),
+            ('flags', '/Ox /fp:fast /OpenMP /arch:avx /std:c++17'),
             ('restrict_qualifier', '__restrict')
         ])
     elif platform.system().lower() == 'darwin':
@@ -168,7 +168,7 @@ def read_config():
             ('os', 'darwin'),
             ('command', 'clang++'),
             ('llc_command', get_llc_command() or 'llc'),
-            ('flags', '-Ofast -DNDEBUG -fPIC -march=native -Xclang -fopenmp -std=c++11'),
+            ('flags', '-Ofast -DNDEBUG -fPIC -march=native -Xclang -fopenmp -std=c++17'),
             ('restrict_qualifier', '__restrict__')
         ])
     default_cache_config = OrderedDict([