Use nested namespace
It's a mechanical change to modernize the code base
This commit is contained in:
@@ -4,9 +4,7 @@
|
||||
#include <boost/spirit/include/phoenix.hpp>
|
||||
#include <boost/spirit/include/qi.hpp>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace util
|
||||
namespace osrm::util
|
||||
{
|
||||
|
||||
#ifndef NDEBUG
|
||||
@@ -16,15 +14,12 @@ inline std::ostream &operator<<(std::ostream &stream, const ConditionalRestricti
|
||||
return stream << restriction.value << "=" << restriction.condition;
|
||||
}
|
||||
#endif
|
||||
} // namespace util
|
||||
} // namespace osrm
|
||||
|
||||
BOOST_FUSION_ADAPT_STRUCT(osrm::util::ConditionalRestriction,
|
||||
(std::string, value)(std::string, condition))
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace util
|
||||
namespace osrm::util
|
||||
{
|
||||
namespace detail
|
||||
{
|
||||
@@ -91,5 +86,4 @@ std::vector<ConditionalRestriction> ParseConditionalRestrictions(const std::stri
|
||||
return result;
|
||||
}
|
||||
|
||||
} // namespace util
|
||||
} // namespace osrm
|
||||
|
||||
@@ -12,9 +12,7 @@
|
||||
#include <iostream>
|
||||
#include <limits>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace util
|
||||
namespace osrm::util
|
||||
{
|
||||
|
||||
bool Coordinate::IsValid() const
|
||||
@@ -42,5 +40,4 @@ bool operator==(const FloatCoordinate lhs, const FloatCoordinate rhs)
|
||||
|
||||
bool operator!=(const Coordinate lhs, const Coordinate rhs) { return !(lhs == rhs); }
|
||||
bool operator!=(const FloatCoordinate lhs, const FloatCoordinate rhs) { return !(lhs == rhs); }
|
||||
} // namespace util
|
||||
} // namespace osrm
|
||||
|
||||
@@ -12,12 +12,7 @@
|
||||
#include <limits>
|
||||
#include <utility>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace util
|
||||
{
|
||||
|
||||
namespace coordinate_calculation
|
||||
namespace osrm::util::coordinate_calculation
|
||||
{
|
||||
|
||||
namespace
|
||||
@@ -419,6 +414,4 @@ double computeArea(const std::vector<Coordinate> &polygon)
|
||||
return area / 2.;
|
||||
}
|
||||
|
||||
} // namespace coordinate_calculation
|
||||
} // namespace util
|
||||
} // namespace osrm
|
||||
|
||||
@@ -11,12 +11,9 @@
|
||||
// this, the compiler will copy the vtable and RTTI into every .o file that
|
||||
// #includes the header, bloating .o file sizes and increasing link times.
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace util
|
||||
namespace osrm::util
|
||||
{
|
||||
|
||||
void exception::anchor() const {}
|
||||
void RuntimeError::anchor() const {}
|
||||
} // namespace util
|
||||
} // namespace osrm
|
||||
|
||||
@@ -11,9 +11,7 @@
|
||||
#include <algorithm>
|
||||
#include <string>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace util
|
||||
namespace osrm::util
|
||||
{
|
||||
|
||||
/**
|
||||
@@ -91,5 +89,4 @@ bool FingerPrint::IsDataCompatible(const FingerPrint &other) const
|
||||
return IsValid() && other.major_version == major_version &&
|
||||
other.minor_version == minor_version;
|
||||
}
|
||||
} // namespace util
|
||||
} // namespace osrm
|
||||
|
||||
@@ -4,9 +4,7 @@
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace util
|
||||
namespace osrm::util
|
||||
{
|
||||
|
||||
//----------------------------------------------------------------
|
||||
@@ -68,5 +66,4 @@ CoordinateVectorToLineString::operator()(const std::vector<util::Coordinate> &in
|
||||
return makeFeature("LineString", std::move(coordinates), properties);
|
||||
}
|
||||
|
||||
} /* namespace util */
|
||||
} /* namespace osrm */
|
||||
|
||||
@@ -4,11 +4,7 @@
|
||||
#include <algorithm>
|
||||
#include <boost/assert.hpp>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace util
|
||||
{
|
||||
namespace guidance
|
||||
namespace osrm::util::guidance
|
||||
{
|
||||
|
||||
BearingClass::BearingClass() { available_bearings.reserve(10); }
|
||||
@@ -77,6 +73,4 @@ std::size_t BearingClass::findMatchingBearing(const double bearing) const
|
||||
return std::distance(available_bearings.begin(), max_element);
|
||||
}
|
||||
|
||||
} // namespace guidance
|
||||
} // namespace util
|
||||
} // namespace osrm
|
||||
|
||||
@@ -4,11 +4,7 @@
|
||||
|
||||
#include <climits>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace util
|
||||
{
|
||||
namespace guidance
|
||||
namespace osrm::util::guidance
|
||||
{
|
||||
|
||||
bool EntryClass::activate(std::uint32_t index)
|
||||
@@ -36,6 +32,4 @@ bool EntryClass::operator<(const EntryClass &other) const
|
||||
return enabled_entries_flags < other.enabled_entries_flags;
|
||||
}
|
||||
|
||||
} // namespace guidance
|
||||
} // namespace util
|
||||
} // namespace osrm
|
||||
|
||||
@@ -6,11 +6,7 @@
|
||||
|
||||
#include <boost/assert.hpp>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace util
|
||||
{
|
||||
namespace guidance
|
||||
namespace osrm::util::guidance
|
||||
{
|
||||
LaneTuple::LaneTuple() : lanes_in_turn(0), first_lane_from_the_right(INVALID_LANEID)
|
||||
{
|
||||
@@ -36,6 +32,4 @@ bool LaneTupleIdPair::operator==(const LaneTupleIdPair &other) const
|
||||
return other.first == first && other.second == second;
|
||||
}
|
||||
|
||||
} // namespace guidance
|
||||
} // namespace util
|
||||
} // namespace osrm
|
||||
|
||||
+1
-4
@@ -7,9 +7,7 @@
|
||||
#include <mutex>
|
||||
#include <string>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace util
|
||||
namespace osrm::util
|
||||
{
|
||||
|
||||
namespace
|
||||
@@ -163,5 +161,4 @@ UnbufferedLog::UnbufferedLog(LogLevel level_)
|
||||
{
|
||||
stream.flags(std::ios_base::unitbuf);
|
||||
}
|
||||
} // namespace util
|
||||
} // namespace osrm
|
||||
|
||||
@@ -10,9 +10,7 @@
|
||||
#include <iomanip>
|
||||
#include <iterator>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace util
|
||||
namespace osrm::util
|
||||
{
|
||||
|
||||
#ifndef NDEBUG
|
||||
@@ -431,5 +429,4 @@ bool CheckOpeningHours(const std::vector<OpeningHours> &input, const struct tm &
|
||||
return is_open;
|
||||
}
|
||||
|
||||
} // namespace util
|
||||
} // namespace osrm
|
||||
|
||||
@@ -1,12 +1,6 @@
|
||||
#include "util/timed_histogram.hpp"
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace util
|
||||
{
|
||||
namespace detail
|
||||
namespace osrm::util::detail
|
||||
{
|
||||
std::atomic_uint operation = {0};
|
||||
}
|
||||
} // namespace util
|
||||
} // namespace osrm
|
||||
|
||||
@@ -21,9 +21,7 @@
|
||||
// Function loads time zone shape polygons, computes a zone local time for utc_time,
|
||||
// creates a lookup R-tree and returns a lambda function that maps a point
|
||||
// to the corresponding local time
|
||||
namespace osrm
|
||||
{
|
||||
namespace updater
|
||||
namespace osrm::updater
|
||||
{
|
||||
|
||||
Timezoner::Timezoner(const char geojson[], std::time_t utc_time_now)
|
||||
@@ -171,5 +169,4 @@ boost::optional<struct tm> Timezoner::operator()(const point_t &point) const
|
||||
}
|
||||
return boost::none;
|
||||
}
|
||||
} // namespace updater
|
||||
} // namespace osrm
|
||||
|
||||
Reference in New Issue
Block a user