[CPP17] Modernize: Replace typedef with using statements

This commit is contained in:
Dennis Luxen
2022-11-06 13:21:45 +01:00
parent fc12b6c365
commit 8bff55cd85
23 changed files with 99 additions and 130 deletions
+2 -2
View File
@@ -17,8 +17,8 @@ struct TestData
EdgeID id;
};
typedef DynamicGraph<TestData> TestDynamicGraph;
typedef TestDynamicGraph::InputEdge TestInputEdge;
using TestDynamicGraph = DynamicGraph<TestData>;
using TestInputEdge = TestDynamicGraph::InputEdge;
BOOST_AUTO_TEST_CASE(find_test)
{
+4 -7
View File
@@ -19,13 +19,10 @@ struct TestData
unsigned value;
};
typedef NodeID TestNodeID;
typedef int TestKey;
typedef int TestWeight;
typedef boost::mpl::list<ArrayStorage<TestNodeID, TestKey>,
MapStorage<TestNodeID, TestKey>,
UnorderedMapStorage<TestNodeID, TestKey>>
storage_types;
using TestNodeID = NodeID;
using TestKey = int;
using TestWeight = int;
using storage_types = boost::mpl::list<ArrayStorage<TestNodeID, TestKey>, MapStorage<TestNodeID, TestKey>, UnorderedMapStorage<TestNodeID, TestKey>>;
template <unsigned NUM_ELEM> struct RandomDataFixture
{
+1 -1
View File
@@ -12,7 +12,7 @@ using namespace osrm;
using namespace osrm::util;
constexpr unsigned BLOCK_SIZE = 16;
typedef RangeTable<BLOCK_SIZE, osrm::storage::Ownership::Container> TestRangeTable;
using TestRangeTable = RangeTable<BLOCK_SIZE, osrm::storage::Ownership::Container>;
void ConstructionTest(const std::vector<unsigned> &lengths, const std::vector<unsigned> &offsets)
{
+5 -5
View File
@@ -17,10 +17,10 @@ struct TestData
EdgeID id;
};
typedef StaticGraph<TestData> TestStaticGraph;
typedef TestStaticGraph::NodeArrayEntry TestNodeArrayEntry;
typedef TestStaticGraph::EdgeArrayEntry TestEdgeArrayEntry;
typedef static_graph_details::SortableEdgeWithData<TestData> TestInputEdge;
using TestStaticGraph = StaticGraph<TestData>;
using TestNodeArrayEntry = TestStaticGraph::NodeArrayEntry;
using TestEdgeArrayEntry = TestStaticGraph::EdgeArrayEntry;
using TestInputEdge = static_graph_details::SortableEdgeWithData<TestData>;
static_assert(traits::HasDataMember<TestInputEdge>::value, "TestInputEdge needs to have data");
@@ -76,7 +76,7 @@ template <unsigned NUM_NODES, unsigned NUM_EDGES> struct RandomArrayEntryFixture
std::vector<unsigned> order;
};
typedef RandomArrayEntryFixture<TEST_NUM_NODES, TEST_NUM_EDGES> TestRandomArrayEntryFixture;
using TestRandomArrayEntryFixture = RandomArrayEntryFixture<TEST_NUM_NODES, TEST_NUM_EDGES>;
BOOST_FIXTURE_TEST_CASE(array_test, TestRandomArrayEntryFixture)
{
+8 -15
View File
@@ -93,8 +93,8 @@ template <unsigned NUM_NODES, unsigned NUM_EDGES> struct RandomGraphFixture
{
struct TupleHash
{
typedef std::pair<unsigned, unsigned> argument_type;
typedef std::size_t result_type;
using argument_type = std::pair<unsigned int, unsigned int>;
using result_type = std::size_t;
result_type operator()(const argument_type &t) const
{
@@ -174,19 +174,12 @@ struct GraphFixture
std::vector<TestData> edges;
};
typedef RandomGraphFixture<TEST_LEAF_NODE_SIZE * 3, TEST_LEAF_NODE_SIZE / 2>
TestRandomGraphFixture_LeafHalfFull;
typedef RandomGraphFixture<TEST_LEAF_NODE_SIZE * 5, TEST_LEAF_NODE_SIZE>
TestRandomGraphFixture_LeafFull;
typedef RandomGraphFixture<TEST_LEAF_NODE_SIZE * 10, TEST_LEAF_NODE_SIZE * 2>
TestRandomGraphFixture_TwoLeaves;
typedef RandomGraphFixture<TEST_LEAF_NODE_SIZE * TEST_BRANCHING_FACTOR * 3,
TEST_LEAF_NODE_SIZE * TEST_BRANCHING_FACTOR>
TestRandomGraphFixture_Branch;
typedef RandomGraphFixture<TEST_LEAF_NODE_SIZE * TEST_BRANCHING_FACTOR * 3,
TEST_LEAF_NODE_SIZE * TEST_BRANCHING_FACTOR * 2>
TestRandomGraphFixture_MultipleLevels;
typedef RandomGraphFixture<10, 30> TestRandomGraphFixture_10_30;
using TestRandomGraphFixture_LeafHalfFull = RandomGraphFixture<TEST_LEAF_NODE_SIZE * 3, TEST_LEAF_NODE_SIZE / 2>;
using TestRandomGraphFixture_LeafFull = RandomGraphFixture<TEST_LEAF_NODE_SIZE * 5, TEST_LEAF_NODE_SIZE>;
using TestRandomGraphFixture_TwoLeaves = RandomGraphFixture<TEST_LEAF_NODE_SIZE * 10, TEST_LEAF_NODE_SIZE * 2>;
using TestRandomGraphFixture_Branch = RandomGraphFixture<TEST_LEAF_NODE_SIZE * TEST_BRANCHING_FACTOR * 3, TEST_LEAF_NODE_SIZE * TEST_BRANCHING_FACTOR>;
using TestRandomGraphFixture_MultipleLevels = RandomGraphFixture<TEST_LEAF_NODE_SIZE * TEST_BRANCHING_FACTOR * 3, TEST_LEAF_NODE_SIZE * TEST_BRANCHING_FACTOR * 2>;
using TestRandomGraphFixture_10_30 = RandomGraphFixture<10, 30>;
template <typename RTreeT>
void simple_verify_rtree(RTreeT &rtree,