fix formatting for (non-generated) internal source files
- Change formatting standard to Cpp11. Main difference is not having
the space between two closing >> for nested templates. We don't
choose c++14, because older versions of clang-format (version 9
and earlier) don't know this value yet, and it doesn't make a
difference in the formatting.
- Apply clang-format to all (non generated) internal source files.
- Manually fix some code sections (clang-format on/off) and c-strings
- Exclude some embedded external files with very different formatting
(gtest/gmock)
- Add script to format all source files
Change-Id: Ic6cea41575ad6e37c9e136dbce176b0d505dc44d
diff --git a/examples/sampled_function/sampled_function.cc b/examples/sampled_function/sampled_function.cc
index 7dec42b..e96018d 100644
--- a/examples/sampled_function/sampled_function.cc
+++ b/examples/sampled_function/sampled_function.cc
@@ -47,7 +47,7 @@
// values with automatic differentiation.
struct InterpolatedCostFunctor {
explicit InterpolatedCostFunctor(
- const CubicInterpolator<Grid1D<double> >& interpolator)
+ const CubicInterpolator<Grid1D<double>>& interpolator)
: interpolator_(interpolator) {}
template <typename T>
@@ -57,13 +57,13 @@
}
static CostFunction* Create(
- const CubicInterpolator<Grid1D<double> >& interpolator) {
+ const CubicInterpolator<Grid1D<double>>& interpolator) {
return new AutoDiffCostFunction<InterpolatedCostFunctor, 1, 1>(
new InterpolatedCostFunctor(interpolator));
}
private:
- const CubicInterpolator<Grid1D<double> >& interpolator_;
+ const CubicInterpolator<Grid1D<double>>& interpolator_;
};
int main(int argc, char** argv) {
@@ -77,7 +77,7 @@
}
Grid1D<double> array(values, 0, kNumSamples);
- CubicInterpolator<Grid1D<double> > interpolator(array);
+ CubicInterpolator<Grid1D<double>> interpolator(array);
double x = 1.0;
Problem problem;