Nest all namespaces

The compiler supports this now.  We can type less going forward.
No functional changes.

Signed-off-by: Stephan Pleines <pleines.stephan@gmail.com>
Change-Id: I29d6fa4f9aacc0e381f1a7637294db0392466995
diff --git a/y2018/control_loops/drivetrain/drivetrain_base.cc b/y2018/control_loops/drivetrain/drivetrain_base.cc
index 9168b4b..92f460d 100644
--- a/y2018/control_loops/drivetrain/drivetrain_base.cc
+++ b/y2018/control_loops/drivetrain/drivetrain_base.cc
@@ -13,9 +13,7 @@
 
 namespace chrono = ::std::chrono;
 
-namespace y2018 {
-namespace control_loops {
-namespace drivetrain {
+namespace y2018::control_loops::drivetrain {
 
 using ::frc971::constants::ShifterHallEffect;
 
@@ -57,6 +55,4 @@
   return kDrivetrainConfig;
 };
 
-}  // namespace drivetrain
-}  // namespace control_loops
-}  // namespace y2018
+}  // namespace y2018::control_loops::drivetrain
diff --git a/y2018/control_loops/python/arm_bounds.cc b/y2018/control_loops/python/arm_bounds.cc
index 1515192..5338993 100644
--- a/y2018/control_loops/python/arm_bounds.cc
+++ b/y2018/control_loops/python/arm_bounds.cc
@@ -7,8 +7,7 @@
 #include <cmath>
 #include <iostream>
 
-namespace y2018 {
-namespace control_loops {
+namespace y2018::control_loops {
 
 static BoundsCheck MakeArbitraryArmSpace(::std::vector<Point> points) {
   for (Point &point : points) {
@@ -534,5 +533,4 @@
                                 {1.8577014383575772, -1.7353804562372057}});
 }
 
-}  // namespace control_loops
-}  // namespace y2018
+}  // namespace y2018::control_loops
diff --git a/y2018/control_loops/superstructure/arm/arm.cc b/y2018/control_loops/superstructure/arm/arm.cc
index 0749e3f..4e70022 100644
--- a/y2018/control_loops/superstructure/arm/arm.cc
+++ b/y2018/control_loops/superstructure/arm/arm.cc
@@ -10,10 +10,7 @@
 #include "y2018/control_loops/superstructure/arm/arm_constants.h"
 #include "y2018/control_loops/superstructure/arm/generated_graph.h"
 
-namespace y2018 {
-namespace control_loops {
-namespace superstructure {
-namespace arm {
+namespace y2018::control_loops::superstructure::arm {
 
 namespace {
 
@@ -432,7 +429,4 @@
   return status_builder.Finish();
 }
 
-}  // namespace arm
-}  // namespace superstructure
-}  // namespace control_loops
-}  // namespace y2018
+}  // namespace y2018::control_loops::superstructure::arm
diff --git a/y2018/control_loops/superstructure/arm/trajectory_plot.cc b/y2018/control_loops/superstructure/arm/trajectory_plot.cc
index 7fdde3f..6739b07 100644
--- a/y2018/control_loops/superstructure/arm/trajectory_plot.cc
+++ b/y2018/control_loops/superstructure/arm/trajectory_plot.cc
@@ -12,10 +12,7 @@
 DEFINE_bool(plot, true, "If true, plot");
 DEFINE_bool(plot_thetas, true, "If true, plot the angles");
 
-namespace y2018 {
-namespace control_loops {
-namespace superstructure {
-namespace arm {
+namespace y2018::control_loops::superstructure::arm {
 
 void Main() {
   frc971::control_loops::arm::Dynamics dynamics(kArmConstants);
@@ -355,10 +352,7 @@
   }
 }
 
-}  // namespace arm
-}  // namespace superstructure
-}  // namespace control_loops
-}  // namespace y2018
+}  // namespace y2018::control_loops::superstructure::arm
 
 int main(int argc, char **argv) {
   ::aos::InitGoogle(&argc, &argv);
diff --git a/y2018/control_loops/superstructure/debouncer.cc b/y2018/control_loops/superstructure/debouncer.cc
index 40b730d..98e80f3 100644
--- a/y2018/control_loops/superstructure/debouncer.cc
+++ b/y2018/control_loops/superstructure/debouncer.cc
@@ -1,8 +1,6 @@
 #include "y2018/control_loops/superstructure/debouncer.h"
 
-namespace y2018 {
-namespace control_loops {
-namespace superstructure {
+namespace y2018::control_loops::superstructure {
 
 void Debouncer::Update(bool new_state) {
   // If the incoming state is different from the one we have stored, increment
@@ -20,6 +18,4 @@
   }
 }
 
-}  // namespace superstructure
-}  // namespace control_loops
-}  // namespace y2018
+}  // namespace y2018::control_loops::superstructure
diff --git a/y2018/control_loops/superstructure/debouncer.h b/y2018/control_loops/superstructure/debouncer.h
index ad46b51..381f2f2 100644
--- a/y2018/control_loops/superstructure/debouncer.h
+++ b/y2018/control_loops/superstructure/debouncer.h
@@ -1,12 +1,10 @@
 #ifndef Y2018_CONTROL_LOOPS_SUPERSTRUCTURE_DEBOUNCER_H_
 #define Y2018_CONTROL_LOOPS_SUPERSTRUCTURE_DEBOUNCER_H_
 
-namespace y2018 {
-namespace control_loops {
-namespace superstructure {
+namespace y2018::control_loops::superstructure {
 
-// Ensures that a certain number of states of a certain type are recieved before
-// the actual state is changed.
+// Ensures that a certain number of states of a certain type are recieved
+// before the actual state is changed.
 class Debouncer {
  public:
   // Parameters:
@@ -37,8 +35,6 @@
   int consistent_count_ = 0;
 };
 
-}  // namespace superstructure
-}  // namespace control_loops
-}  // namespace y2018
+}  // namespace y2018::control_loops::superstructure
 
 #endif  // Y2018_CONTROL_LOOPS_SUPERSTRUCTURE_DEBOUNCER_H_
diff --git a/y2018/control_loops/superstructure/debouncer_test.cc b/y2018/control_loops/superstructure/debouncer_test.cc
index 2f56d56..ba3bd87 100644
--- a/y2018/control_loops/superstructure/debouncer_test.cc
+++ b/y2018/control_loops/superstructure/debouncer_test.cc
@@ -2,10 +2,7 @@
 
 #include "gtest/gtest.h"
 
-namespace y2018 {
-namespace control_loops {
-namespace superstructure {
-namespace testing {
+namespace y2018::control_loops::superstructure::testing {
 
 // Tests that the debouncer behaves as it should. This tests the following:
 // - The debouncer changes its internal state after the desired number of
@@ -53,7 +50,4 @@
 
   EXPECT_EQ(true, bouncer.current_state());
 }
-}  // namespace testing
-}  // namespace superstructure
-}  // namespace control_loops
-}  // namespace y2018
+}  // namespace y2018::control_loops::superstructure::testing
diff --git a/y2018/control_loops/superstructure/intake/intake.cc b/y2018/control_loops/superstructure/intake/intake.cc
index edefca4..4c96de0 100644
--- a/y2018/control_loops/superstructure/intake/intake.cc
+++ b/y2018/control_loops/superstructure/intake/intake.cc
@@ -8,10 +8,7 @@
 #include "y2018/control_loops/superstructure/intake/intake_delayed_plant.h"
 #include "y2018/control_loops/superstructure/intake/intake_plant.h"
 
-namespace y2018 {
-namespace control_loops {
-namespace superstructure {
-namespace intake {
+namespace y2018::control_loops::superstructure::intake {
 
 namespace chrono = ::std::chrono;
 using ::aos::monotonic_clock;
@@ -179,7 +176,4 @@
   return status_builder.Finish();
 }
 
-}  // namespace intake
-}  // namespace superstructure
-}  // namespace control_loops
-}  // namespace y2018
+}  // namespace y2018::control_loops::superstructure::intake
diff --git a/y2018/control_loops/superstructure/superstructure.cc b/y2018/control_loops/superstructure/superstructure.cc
index fc08280..f0748fa 100644
--- a/y2018/control_loops/superstructure/superstructure.cc
+++ b/y2018/control_loops/superstructure/superstructure.cc
@@ -10,9 +10,7 @@
 #include "y2018/status_light_generated.h"
 #include "y2018/vision/vision_generated.h"
 
-namespace y2018 {
-namespace control_loops {
-namespace superstructure {
+namespace y2018::control_loops::superstructure {
 
 using ::aos::monotonic_clock;
 
@@ -350,6 +348,4 @@
   }
 }
 
-}  // namespace superstructure
-}  // namespace control_loops
-}  // namespace y2018
+}  // namespace y2018::control_loops::superstructure
diff --git a/y2018/control_loops/superstructure/superstructure_lib_test.cc b/y2018/control_loops/superstructure/superstructure_lib_test.cc
index b142420..fdd467b 100644
--- a/y2018/control_loops/superstructure/superstructure_lib_test.cc
+++ b/y2018/control_loops/superstructure/superstructure_lib_test.cc
@@ -19,10 +19,7 @@
 
 using ::frc971::control_loops::PositionSensorSimulator;
 
-namespace y2018 {
-namespace control_loops {
-namespace superstructure {
-namespace testing {
+namespace y2018::control_loops::superstructure::testing {
 namespace {
 constexpr double kNoiseScalar = 0.01;
 }  // namespace
@@ -786,7 +783,4 @@
 // TODO(austin): Test multiple path segments.
 // TODO(austin): Disable in the middle and test recovery.
 
-}  // namespace testing
-}  // namespace superstructure
-}  // namespace control_loops
-}  // namespace y2018
+}  // namespace y2018::control_loops::superstructure::testing