[CPP17] Modernize: Replace typedef with using statements
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user