summaryrefslogtreecommitdiffstats
path: root/Help/guide/tutorial/Step2/MathFunctions/mysqrt.cxx
diff options
context:
space:
mode:
authorMarkus Ferrell <markus.ferrell@kitware.com>2023-02-10 21:07:06 (GMT)
committerMarkus Ferrell <markus.ferrell@kitware.com>2023-02-23 14:42:10 (GMT)
commit8ddf32196c6bca9c3a80414222327eebd5d51835 (patch)
tree40ad09ab3e93b4d1bbc642fc921f1ddb3737853b /Help/guide/tutorial/Step2/MathFunctions/mysqrt.cxx
parent78299083d24fc09c777292effb4fdb9d9ed1d7d3 (diff)
downloadCMake-8ddf32196c6bca9c3a80414222327eebd5d51835.zip
CMake-8ddf32196c6bca9c3a80414222327eebd5d51835.tar.gz
CMake-8ddf32196c6bca9c3a80414222327eebd5d51835.tar.bz2
Tutorial: Refactor MathFunctions code
Propagate the refactor in Step 10 MathFunctions through all of the steps. Use MathFunctions/MathFunctions.cxx instead of Tutorial.cxx to determine which sqrt library is called. Adds .h files which correspond to their .cxx files by name.
Diffstat (limited to 'Help/guide/tutorial/Step2/MathFunctions/mysqrt.cxx')
-rw-r--r--Help/guide/tutorial/Step2/MathFunctions/mysqrt.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/Help/guide/tutorial/Step2/MathFunctions/mysqrt.cxx b/Help/guide/tutorial/Step2/MathFunctions/mysqrt.cxx
index 1e4d97a..ba0ac64 100644
--- a/Help/guide/tutorial/Step2/MathFunctions/mysqrt.cxx
+++ b/Help/guide/tutorial/Step2/MathFunctions/mysqrt.cxx
@@ -1,5 +1,9 @@
+#include "mysqrt.h"
+
#include <iostream>
+namespace mathfunctions {
+namespace detail {
// a hack square root calculation using simple operations
double mysqrt(double x)
{
@@ -20,3 +24,5 @@ double mysqrt(double x)
}
return result;
}
+}
+}