diff --git a/applications/utilities/preProcessing/viewFactorsGen/viewFactorsGen.C b/applications/utilities/preProcessing/viewFactorsGen/viewFactorsGen.C
index 9e9c3d344093b85ce5ffeaeb6130ff1f914429b3..a13eac5fea9967320614782f5663559a7c1b11df 100644
--- a/applications/utilities/preProcessing/viewFactorsGen/viewFactorsGen.C
+++ b/applications/utilities/preProcessing/viewFactorsGen/viewFactorsGen.C
@@ -6,7 +6,7 @@
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
     Copyright (C) 2011-2016 OpenFOAM Foundation
-    Copyright (C) 2016-2022 OpenCFD Ltd.
+    Copyright (C) 2016-2024 OpenCFD Ltd.
 -------------------------------------------------------------------------------
 License
     This file is part of OpenFOAM.
@@ -119,7 +119,13 @@ typedef std::vector<Triangle>::iterator Iterator;
 typedef CGAL::AABB_triangle_primitive<K, Iterator> Primitive;
 typedef CGAL::AABB_traits<K, Primitive> AABB_triangle_traits;
 typedef CGAL::AABB_tree<AABB_triangle_traits> Tree;
+
+// Used boost::optional prior to CGAL-6.0
+#if (CGAL_VERSION_NR < 1060000910)
 typedef boost::optional
+#else
+typedef std::optional
+#endif
 <
     Tree::Intersection_and_primitive_id<Segment>::Type
 > Segment_intersection;
diff --git a/applications/utilities/surface/surfaceBooleanFeatures/surfaceBooleanFeatures.C b/applications/utilities/surface/surfaceBooleanFeatures/surfaceBooleanFeatures.C
index b7f2715b253ac96b1bae0d758899d97d6408fd67..009ce430eb057ebd185f7ecae3338e30b0ed6b64 100644
--- a/applications/utilities/surface/surfaceBooleanFeatures/surfaceBooleanFeatures.C
+++ b/applications/utilities/surface/surfaceBooleanFeatures/surfaceBooleanFeatures.C
@@ -6,7 +6,7 @@
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
     Copyright (C) 2011-2016 OpenFOAM Foundation
-    Copyright (C) 2016-2022 OpenCFD Ltd.
+    Copyright (C) 2016-2024 OpenCFD Ltd.
 -------------------------------------------------------------------------------
 License
     This file is part of OpenFOAM.
@@ -108,7 +108,12 @@ typedef CGAL::AABB_face_graph_triangle_primitive
 typedef CGAL::AABB_traits<K, Primitive> Traits;
 typedef CGAL::AABB_tree<Traits> Tree;
 
+// Used boost::optional prior to CGAL-6.0
+#if (CGAL_VERSION_NR < 1060000910)
 typedef boost::optional
+#else
+typedef std::optional
+#endif
 <
     Tree::Intersection_and_primitive_id<Segment>::Type
 > Segment_intersection;
@@ -647,7 +652,12 @@ labelPair edgeIntersectionsCGAL
             // Get intersection object
             if
             (
+                // Used boost::variant prior to CGAL-6.0
+                #if (CGAL_VERSION_NR < 1060000910)
                 const Point* ptPtr = boost::get<Point>(&(intersect->first))
+                #else
+                const Point* ptPtr = std::get_if<Point>(&(intersect->first))
+                #endif
             )
             {
                 point pt
@@ -679,7 +689,12 @@ labelPair edgeIntersectionsCGAL
             }
             else if
             (
+                // Used boost::variant prior to CGAL-6.0
+                #if (CGAL_VERSION_NR < 1060000910)
                 const Segment* sPtr = boost::get<Segment>(&(intersect->first))
+                #else
+                const Segment* sPtr = std::get_if<Segment>(&(intersect->first))
+                #endif
             )
             {
                 #if defined (CGAL_VERSION_NR) && (CGAL_VERSION_NR < 1041400000)