Change typedef to using.

Conflicts:
	src/ripple/app/TODO.md
	src/ripple/app/ledger/Ledger.h
	src/ripple/protocol/Protocol.h
This commit is contained in:
Howard Hinnant
2015-05-21 19:12:10 -04:00
committed by Vinnie Falco
parent 9ad5644a8c
commit 845c9f8a51
90 changed files with 362 additions and 362 deletions

View File

@@ -39,13 +39,13 @@ template <class T, class U,
bool = std::is_const <std::remove_reference_t <T>>::value>
struct apply_const
{
typedef U type;
using type = U;
};
template <class T, class U>
struct apply_const <T, U, true>
{
typedef const U type;
using type = const U;
};
// is_contiguous is true if C is a contiguous container
@@ -161,7 +161,7 @@ private:
void
assign (Iter first, Iter last) noexcept
{
typedef typename std::iterator_traits <Iter>::value_type U;
using U = typename std::iterator_traits <Iter>::value_type;
static_assert (detail::buffer_view_const_compatible <T, U>::value,
"Cannot convert from 'U const' to 'T', "
@@ -190,17 +190,17 @@ private:
}
public:
typedef T value_type;
typedef std::size_t size_type;
typedef std::ptrdiff_t difference_type;
typedef T& reference;
typedef T const& const_reference;
typedef T* pointer;
typedef T const* const_pointer;
typedef T* iterator;
typedef T const* const_iterator;
typedef std::reverse_iterator <iterator> reverse_iterator;
typedef std::reverse_iterator <const_iterator> const_reverse_iterator;
using value_type = T;
using size_type = std::size_t;
using difference_type = std::ptrdiff_t;
using reference = T&;
using const_reference = T const&;
using pointer = T*;
using const_pointer = T const*;
using iterator = T*;
using const_iterator = T const*;
using reverse_iterator = std::reverse_iterator <iterator>;
using const_reverse_iterator = std::reverse_iterator <const_iterator>;
// default construct
buffer_view () noexcept

View File

@@ -30,7 +30,7 @@ template <class Container>
class const_container
{
private:
typedef Container cont_type;
using cont_type = Container;
cont_type m_cont;
@@ -46,11 +46,11 @@ protected:
}
public:
typedef typename cont_type::value_type value_type;
typedef typename cont_type::size_type size_type;
typedef typename cont_type::difference_type difference_type;
typedef typename cont_type::const_iterator iterator;
typedef typename cont_type::const_iterator const_iterator;
using value_type = typename cont_type::value_type;
using size_type = typename cont_type::size_type;
using difference_type = typename cont_type::difference_type;
using iterator = typename cont_type::const_iterator;
using const_iterator = typename cont_type::const_iterator;
/** Returns `true` if the container is empty. */
bool

View File

@@ -61,7 +61,7 @@ struct cyclic_iterator_category<
std::forward_iterator_tag
>
{
typedef std::forward_iterator_tag type;
using type = std::forward_iterator_tag;
};
template<>
@@ -69,7 +69,7 @@ struct cyclic_iterator_category<
std::bidirectional_iterator_tag
>
{
typedef std::bidirectional_iterator_tag type;
using type = std::bidirectional_iterator_tag;
};
template<>
@@ -77,7 +77,7 @@ struct cyclic_iterator_category<
std::random_access_iterator_tag
>
{
typedef std::bidirectional_iterator_tag type;
using type = std::bidirectional_iterator_tag;
};
}
@@ -94,7 +94,7 @@ template<
>
struct cyclic_iterator_base
{
typedef boost::iterator_facade<
using type = boost::iterator_facade<
cyclic_iterator<
ContainerIterator
>,
@@ -109,7 +109,7 @@ struct cyclic_iterator_base
typename std::iterator_traits<
ContainerIterator
>::reference
> type;
>;
};
}
@@ -153,39 +153,39 @@ public:
/**
\brief The base type which is a <code>boost::iterator_facade</code>
*/
typedef typename detail::cyclic_iterator_base<
using base_type = typename detail::cyclic_iterator_base<
ContainerIterator
>::type base_type;
>::type;
/**
\brief The underlying iterator type
*/
typedef ContainerIterator container_iterator_type;
using container_iterator_type = ContainerIterator;
/**
\brief The value type adapted from \a ContainerIterator
*/
typedef typename base_type::value_type value_type;
using value_type = typename base_type::value_type;
/**
\brief The reference type adapted from \a ContainerIterator
*/
typedef typename base_type::reference reference;
using reference = typename base_type::reference;
/**
\brief The pointer type adapted from \a ContainerIterator
*/
typedef typename base_type::pointer pointer;
using pointer = typename base_type::pointer;
/**
\brief The difference type adapted from \a ContainerIterator
*/
typedef typename base_type::difference_type difference_type;
using difference_type = typename base_type::difference_type;
/**
\brief The iterator category, either Forward or Bidirectional
*/
typedef typename base_type::iterator_category iterator_category;
using iterator_category = typename base_type::iterator_category;
/**
\brief Creates a singular iterator

View File

@@ -249,7 +249,7 @@ private:
};
using list_type = typename boost::intrusive::make_list <element,
boost::intrusive::constant_time_size <false>>::type ;
boost::intrusive::constant_time_size <false>>::type;
using cont_type = typename std::conditional <
IsMulti,

View File

@@ -113,14 +113,14 @@ public:
template <class T>
struct AllocT
{
typedef T value_type;
using value_type = T;
//typedef propagate_on_container_swap : std::true_type::type;
//using std::true_type::type = propagate_on_container_swap :;
template <class U>
struct rebind
{
typedef AllocT <U> other;
using other = AllocT <U>;
};
explicit AllocT (int)
@@ -170,8 +170,8 @@ public:
class MaybeUnordered : public Base
{
public:
typedef std::less <typename Base::Key> Comp;
typedef CompT <typename Base::Key> MyComp;
using Comp = std::less <typename Base::Key>;
using MyComp = CompT <typename Base::Key>;
protected:
static std::string name_ordered_part()
@@ -185,10 +185,10 @@ public:
class MaybeUnordered <Base, true> : public Base
{
public:
typedef std::hash <typename Base::Key> Hash;
typedef std::equal_to <typename Base::Key> Equal;
typedef HashT <typename Base::Key> MyHash;
typedef EqualT <typename Base::Key> MyEqual;
using Hash = std::hash <typename Base::Key>;
using Equal = std::equal_to <typename Base::Key>;
using MyHash = HashT <typename Base::Key>;
using MyEqual = EqualT <typename Base::Key>;
protected:
static std::string name_ordered_part()
@@ -226,9 +226,9 @@ public:
class MaybeMap : public Base
{
public:
typedef void T;
typedef typename Base::Key Value;
typedef std::vector <Value> Values;
using T = void;
using Value = typename Base::Key;
using Values = std::vector <Value>;
static typename Base::Key const& extract (Value const& value)
{
@@ -259,9 +259,9 @@ public:
class MaybeMap <Base, true> : public Base
{
public:
typedef int T;
typedef std::pair <typename Base::Key, T> Value;
typedef std::vector <Value> Values;
using T = int;
using Value = std::pair <typename Base::Key, T>;
using Values = std::vector <Value>;
static typename Base::Key const& extract (Value const& value)
{
@@ -326,9 +326,9 @@ public:
struct TestTraitsBase
{
typedef std::string Key;
typedef std::chrono::steady_clock Clock;
typedef manual_clock<Clock> ManualClock;
using Key = std::string;
using Clock = std::chrono::steady_clock;
using ManualClock = manual_clock<Clock>;
};
template <bool IsUnordered, bool IsMulti, bool IsMap>
@@ -337,18 +337,18 @@ public:
TestTraitsBase, IsMap>, IsMulti>, IsUnordered>
{
private:
typedef MaybeUnordered <MaybeMulti <MaybeMap <
TestTraitsBase, IsMap>, IsMulti>, IsUnordered> Base;
using Base = MaybeUnordered <MaybeMulti <MaybeMap <
TestTraitsBase, IsMap>, IsMulti>, IsUnordered>;
public:
using typename Base::Key;
typedef std::integral_constant <bool, IsUnordered> is_unordered;
typedef std::integral_constant <bool, IsMulti> is_multi;
typedef std::integral_constant <bool, IsMap> is_map;
using is_unordered = std::integral_constant <bool, IsUnordered>;
using is_multi = std::integral_constant <bool, IsMulti>;
using is_map = std::integral_constant <bool, IsMap>;
typedef std::allocator <typename Base::Value> Alloc;
typedef AllocT <typename Base::Value> MyAlloc;
using Alloc = std::allocator <typename Base::Value>;
using MyAlloc = AllocT <typename Base::Value>;
static std::string name()
{
@@ -645,13 +645,13 @@ typename std::enable_if <
aged_associative_container_test_base::
checkUnorderedContentsRefRef (C&& c, Values const& v)
{
typedef typename std::remove_reference <C>::type Cont;
typedef TestTraits <
using Cont = typename std::remove_reference <C>::type;
using Traits = TestTraits <
Cont::is_unordered::value,
Cont::is_multi::value,
Cont::is_map::value
> Traits;
typedef typename Cont::size_type size_type;
>;
using size_type = typename Cont::size_type;
auto const hash (c.hash_function());
auto const key_eq (c.key_eq());
for (size_type i (0); i < c.bucket_count(); ++i)
@@ -679,13 +679,13 @@ void
aged_associative_container_test_base::
checkContentsRefRef (C&& c, Values const& v)
{
typedef typename std::remove_reference <C>::type Cont;
typedef TestTraits <
using Cont = typename std::remove_reference <C>::type;
using Traits = TestTraits <
Cont::is_unordered::value,
Cont::is_multi::value,
Cont::is_map::value
> Traits;
typedef typename Cont::size_type size_type;
>;
using size_type = typename Cont::size_type;
expect (c.size() == v.size());
expect (size_type (std::distance (
@@ -719,12 +719,12 @@ void
aged_associative_container_test_base::
checkContents (Cont& c)
{
typedef TestTraits <
using Traits = TestTraits <
Cont::is_unordered::value,
Cont::is_multi::value,
Cont::is_map::value
> Traits;
typedef typename Traits::Values Values;
>;
using Values = typename Traits::Values;
checkContents (c, Values());
}
@@ -740,15 +740,15 @@ typename std::enable_if <! IsUnordered>::type
aged_associative_container_test_base::
testConstructEmpty ()
{
typedef TestTraits <IsUnordered, IsMulti, IsMap> Traits;
typedef typename Traits::Value Value;
typedef typename Traits::Key Key;
typedef typename Traits::T T;
typedef typename Traits::Clock Clock;
typedef typename Traits::Comp Comp;
typedef typename Traits::Alloc Alloc;
typedef typename Traits::MyComp MyComp;
typedef typename Traits::MyAlloc MyAlloc;
using Traits = TestTraits <IsUnordered, IsMulti, IsMap>;
using Value = typename Traits::Value;
using Key = typename Traits::Key;
using T = typename Traits::T;
using Clock = typename Traits::Clock;
using Comp = typename Traits::Comp;
using Alloc = typename Traits::Alloc;
using MyComp = typename Traits::MyComp;
using MyAlloc = typename Traits::MyAlloc;
typename Traits::ManualClock clock;
//testcase (Traits::name() + " empty");
@@ -785,17 +785,17 @@ typename std::enable_if <IsUnordered>::type
aged_associative_container_test_base::
testConstructEmpty ()
{
typedef TestTraits <IsUnordered, IsMulti, IsMap> Traits;
typedef typename Traits::Value Value;
typedef typename Traits::Key Key;
typedef typename Traits::T T;
typedef typename Traits::Clock Clock;
typedef typename Traits::Hash Hash;
typedef typename Traits::Equal Equal;
typedef typename Traits::Alloc Alloc;
typedef typename Traits::MyHash MyHash;
typedef typename Traits::MyEqual MyEqual;
typedef typename Traits::MyAlloc MyAlloc;
using Traits = TestTraits <IsUnordered, IsMulti, IsMap>;
using Value = typename Traits::Value;
using Key = typename Traits::Key;
using T = typename Traits::T;
using Clock = typename Traits::Clock;
using Hash = typename Traits::Hash;
using Equal = typename Traits::Equal;
using Alloc = typename Traits::Alloc;
using MyHash = typename Traits::MyHash;
using MyEqual = typename Traits::MyEqual;
using MyAlloc = typename Traits::MyAlloc;
typename Traits::ManualClock clock;
//testcase (Traits::name() + " empty");
@@ -855,15 +855,15 @@ typename std::enable_if <! IsUnordered>::type
aged_associative_container_test_base::
testConstructRange ()
{
typedef TestTraits <IsUnordered, IsMulti, IsMap> Traits;
typedef typename Traits::Value Value;
typedef typename Traits::Key Key;
typedef typename Traits::T T;
typedef typename Traits::Clock Clock;
typedef typename Traits::Comp Comp;
typedef typename Traits::Alloc Alloc;
typedef typename Traits::MyComp MyComp;
typedef typename Traits::MyAlloc MyAlloc;
using Traits = TestTraits <IsUnordered, IsMulti, IsMap>;
using Value = typename Traits::Value;
using Key = typename Traits::Key;
using T = typename Traits::T;
using Clock = typename Traits::Clock;
using Comp = typename Traits::Comp;
using Alloc = typename Traits::Alloc;
using MyComp = typename Traits::MyComp;
using MyAlloc = typename Traits::MyAlloc;
typename Traits::ManualClock clock;
auto const v (Traits::values());
@@ -918,17 +918,17 @@ typename std::enable_if <IsUnordered>::type
aged_associative_container_test_base::
testConstructRange ()
{
typedef TestTraits <IsUnordered, IsMulti, IsMap> Traits;
typedef typename Traits::Value Value;
typedef typename Traits::Key Key;
typedef typename Traits::T T;
typedef typename Traits::Clock Clock;
typedef typename Traits::Hash Hash;
typedef typename Traits::Equal Equal;
typedef typename Traits::Alloc Alloc;
typedef typename Traits::MyHash MyHash;
typedef typename Traits::MyEqual MyEqual;
typedef typename Traits::MyAlloc MyAlloc;
using Traits = TestTraits <IsUnordered, IsMulti, IsMap>;
using Value = typename Traits::Value;
using Key = typename Traits::Key;
using T = typename Traits::T;
using Clock = typename Traits::Clock;
using Hash = typename Traits::Hash;
using Equal = typename Traits::Equal;
using Alloc = typename Traits::Alloc;
using MyHash = typename Traits::MyHash;
using MyEqual = typename Traits::MyEqual;
using MyAlloc = typename Traits::MyAlloc;
typename Traits::ManualClock clock;
auto const v (Traits::values());
@@ -998,15 +998,15 @@ typename std::enable_if <! IsUnordered>::type
aged_associative_container_test_base::
testConstructInitList ()
{
typedef TestTraits <IsUnordered, IsMulti, IsMap> Traits;
typedef typename Traits::Value Value;
typedef typename Traits::Key Key;
typedef typename Traits::T T;
typedef typename Traits::Clock Clock;
typedef typename Traits::Comp Comp;
typedef typename Traits::Alloc Alloc;
typedef typename Traits::MyComp MyComp;
typedef typename Traits::MyAlloc MyAlloc;
using Traits = TestTraits <IsUnordered, IsMulti, IsMap>;
using Value = typename Traits::Value;
using Key = typename Traits::Key;
using T = typename Traits::T;
using Clock = typename Traits::Clock;
using Comp = typename Traits::Comp;
using Alloc = typename Traits::Alloc;
using MyComp = typename Traits::MyComp;
using MyAlloc = typename Traits::MyAlloc;
typename Traits::ManualClock clock;
//testcase (Traits::name() + " init-list");
@@ -1023,17 +1023,17 @@ typename std::enable_if <IsUnordered>::type
aged_associative_container_test_base::
testConstructInitList ()
{
typedef TestTraits <IsUnordered, IsMulti, IsMap> Traits;
typedef typename Traits::Value Value;
typedef typename Traits::Key Key;
typedef typename Traits::T T;
typedef typename Traits::Clock Clock;
typedef typename Traits::Hash Hash;
typedef typename Traits::Equal Equal;
typedef typename Traits::Alloc Alloc;
typedef typename Traits::MyHash MyHash;
typedef typename Traits::MyEqual MyEqual;
typedef typename Traits::MyAlloc MyAlloc;
using Traits = TestTraits <IsUnordered, IsMulti, IsMap>;
using Value = typename Traits::Value;
using Key = typename Traits::Key;
using T = typename Traits::T;
using Clock = typename Traits::Clock;
using Hash = typename Traits::Hash;
using Equal = typename Traits::Equal;
using Alloc = typename Traits::Alloc;
using MyHash = typename Traits::MyHash;
using MyEqual = typename Traits::MyEqual;
using MyAlloc = typename Traits::MyAlloc;
typename Traits::ManualClock clock;
//testcase (Traits::name() + " init-list");
@@ -1054,9 +1054,9 @@ void
aged_associative_container_test_base::
testCopyMove ()
{
typedef TestTraits <IsUnordered, IsMulti, IsMap> Traits;
typedef typename Traits::Value Value;
typedef typename Traits::Alloc Alloc;
using Traits = TestTraits <IsUnordered, IsMulti, IsMap>;
using Value = typename Traits::Value;
using Alloc = typename Traits::Alloc;
typename Traits::ManualClock clock;
auto const v (Traits::values());
@@ -1136,9 +1136,9 @@ void
aged_associative_container_test_base::
testIterator()
{
typedef TestTraits <IsUnordered, IsMulti, IsMap> Traits;
typedef typename Traits::Value Value;
typedef typename Traits::Alloc Alloc;
using Traits = TestTraits <IsUnordered, IsMulti, IsMap>;
using Value = typename Traits::Value;
using Alloc = typename Traits::Alloc;
typename Traits::ManualClock clock;
auto const v (Traits::values());
@@ -1199,9 +1199,9 @@ typename std::enable_if <! IsUnordered>::type
aged_associative_container_test_base::
testReverseIterator()
{
typedef TestTraits <IsUnordered, IsMulti, IsMap> Traits;
typedef typename Traits::Value Value;
typedef typename Traits::Alloc Alloc;
using Traits = TestTraits <IsUnordered, IsMulti, IsMap>;
using Value = typename Traits::Value;
using Alloc = typename Traits::Alloc;
typename Traits::ManualClock clock;
auto const v (Traits::values());
@@ -1356,7 +1356,7 @@ void
aged_associative_container_test_base::
testModifiers()
{
typedef TestTraits <IsUnordered, IsMulti, IsMap> Traits;
using Traits = TestTraits <IsUnordered, IsMulti, IsMap>;
typename Traits::ManualClock clock;
auto const v (Traits::values());
auto const l (make_list (v));
@@ -1416,8 +1416,8 @@ void
aged_associative_container_test_base::
testChronological ()
{
typedef TestTraits <IsUnordered, IsMulti, IsMap> Traits;
typedef typename Traits::Value Value;
using Traits = TestTraits <IsUnordered, IsMulti, IsMap>;
using Value = typename Traits::Value;
typename Traits::ManualClock clock;
auto const v (Traits::values());
@@ -1483,7 +1483,7 @@ typename std::enable_if <IsMap && ! IsMulti>::type
aged_associative_container_test_base::
testArrayCreate()
{
typedef TestTraits <IsUnordered, IsMulti, IsMap> Traits;
using Traits = TestTraits <IsUnordered, IsMulti, IsMap>;
typename Traits::ManualClock clock;
auto v (Traits::values());
@@ -1523,7 +1523,7 @@ reverseFillAgedContainer (Container& c, Values const& values)
// c.clock() returns an abstract_clock, so dynamic_cast to manual_clock.
// VFALCO NOTE This is sketchy
typedef TestTraitsBase::ManualClock ManualClock;
using ManualClock = TestTraitsBase::ManualClock;
ManualClock& clk (dynamic_cast <ManualClock&> (c.clock()));
clk.set (0);
@@ -1621,7 +1621,7 @@ void
aged_associative_container_test_base::
testElementErase ()
{
typedef TestTraits <IsUnordered, IsMulti, IsMap> Traits;
using Traits = TestTraits <IsUnordered, IsMulti, IsMap>;
//testcase (Traits::name() + " element erase"
testcase ("element erase");
@@ -1751,7 +1751,7 @@ void
aged_associative_container_test_base::
testRangeErase ()
{
typedef TestTraits <IsUnordered, IsMulti, IsMap> Traits;
using Traits = TestTraits <IsUnordered, IsMulti, IsMap>;
//testcase (Traits::name() + " element erase"
testcase ("range erase");
@@ -1784,8 +1784,8 @@ typename std::enable_if <! IsUnordered>::type
aged_associative_container_test_base::
testCompare ()
{
typedef TestTraits <IsUnordered, IsMulti, IsMap> Traits;
typedef typename Traits::Value Value;
using Traits = TestTraits <IsUnordered, IsMulti, IsMap>;
using Value = typename Traits::Value;
typename Traits::ManualClock clock;
auto const v (Traits::values());
@@ -1819,7 +1819,7 @@ typename std::enable_if <! IsUnordered>::type
aged_associative_container_test_base::
testObservers()
{
typedef TestTraits <IsUnordered, IsMulti, IsMap> Traits;
using Traits = TestTraits <IsUnordered, IsMulti, IsMap>;
typename Traits::ManualClock clock;
//testcase (Traits::name() + " observers");
@@ -1838,7 +1838,7 @@ typename std::enable_if <IsUnordered>::type
aged_associative_container_test_base::
testObservers()
{
typedef TestTraits <IsUnordered, IsMulti, IsMap> Traits;
using Traits = TestTraits <IsUnordered, IsMulti, IsMap>;
typename Traits::ManualClock clock;
//testcase (Traits::name() + " observers");
@@ -1862,7 +1862,7 @@ void
aged_associative_container_test_base::
testMaybeUnorderedMultiMap ()
{
typedef TestTraits <IsUnordered, IsMulti, IsMap> Traits;
using Traits = TestTraits <IsUnordered, IsMulti, IsMap>;
testConstructEmpty <IsUnordered, IsMulti, IsMap> ();
testConstructRange <IsUnordered, IsMulti, IsMap> ();
@@ -1886,8 +1886,8 @@ class aged_set_test : public aged_associative_container_test_base
public:
// Compile time checks
typedef std::string Key;
typedef int T;
using Key = std::string;
using T = int;
static_assert (std::is_same <
aged_set <Key>,