mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-21 23:00:50 +08:00

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.
16 lines
327 B
C++
16 lines
327 B
C++
#include "MathFunctions.h"
|
|
|
|
// TODO 11: include cmath
|
|
|
|
// TODO 10: Wrap the mysqrt include in a precompiled ifdef based on USE_MYMATH
|
|
#include "mysqrt.h"
|
|
|
|
namespace mathfunctions {
|
|
double sqrt(double x)
|
|
{
|
|
// TODO 9: If USE_MYMATH is defined, use detail::mysqrt.
|
|
// Otherwise, use std::sqrt.
|
|
return detail::mysqrt(x);
|
|
}
|
|
}
|