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 52f298f150
commit 155fcdbcd0
224 changed files with 790 additions and 844 deletions

View File

@@ -27,7 +27,7 @@ namespace ripple {
/** Storage for linear binary data.
Blocks of binary data appear often in various idioms and structures.
*/
typedef std::vector <unsigned char> Blob;
using Blob = std::vector <unsigned char>;
}

View File

@@ -33,7 +33,7 @@ template <bool ByValue>
class BookType
{
public:
typedef IssueType <ByValue> Issue;
using Issue = IssueType <ByValue>;
Issue in;
Issue out;
@@ -166,8 +166,8 @@ bool operator<= (BookType <LhsByValue> const& lhs,
//------------------------------------------------------------------------------
typedef BookType <true> Book;
typedef BookType <false> BookRef;
using Book = BookType <true>;
using BookRef = BookType <false>;
}
@@ -181,14 +181,14 @@ struct hash <ripple::IssueType <ByValue>>
, private boost::base_from_member <std::hash <ripple::Account>, 1>
{
private:
typedef boost::base_from_member <
std::hash <ripple::Currency>, 0> currency_hash_type;
typedef boost::base_from_member <
std::hash <ripple::Account>, 1> issuer_hash_type;
using currency_hash_type = boost::base_from_member <
std::hash <ripple::Currency>, 0>;
using issuer_hash_type = boost::base_from_member <
std::hash <ripple::Account>, 1>;
public:
typedef std::size_t value_type;
typedef ripple::IssueType <ByValue> argument_type;
using value_type = std::size_t;
using argument_type = ripple::IssueType <ByValue>;
value_type operator() (argument_type const& value) const
{
@@ -206,13 +206,13 @@ template <bool ByValue>
struct hash <ripple::BookType <ByValue>>
{
private:
typedef std::hash <ripple::IssueType <ByValue>> hasher;
using hasher = std::hash <ripple::IssueType <ByValue>>;
hasher m_hasher;
public:
typedef std::size_t value_type;
typedef ripple::BookType <ByValue> argument_type;
using value_type = std::size_t;
using argument_type = ripple::BookType <ByValue>;
value_type operator() (argument_type const& value) const
{
@@ -232,7 +232,7 @@ template <bool ByValue>
struct hash <ripple::IssueType <ByValue>>
: std::hash <ripple::IssueType <ByValue>>
{
typedef std::hash <ripple::IssueType <ByValue>> Base;
using Base = std::hash <ripple::IssueType <ByValue>>;
// VFALCO NOTE broken in vs2012
//using Base::Base; // inherit ctors
};
@@ -241,7 +241,7 @@ template <bool ByValue>
struct hash <ripple::BookType <ByValue>>
: std::hash <ripple::BookType <ByValue>>
{
typedef std::hash <ripple::BookType <ByValue>> Base;
using Base = std::hash <ripple::BookType <ByValue>>;
// VFALCO NOTE broken in vs2012
//using Base::Base; // inherit ctors
};

View File

@@ -39,13 +39,11 @@ template <bool ByValue>
class IssueType
{
public:
typedef typename
std::conditional <ByValue, Currency, Currency const&>::type
IssueCurrency;
using IssueCurrency = typename
std::conditional <ByValue, Currency, Currency const&>::type;
typedef typename
std::conditional <ByValue, Account, Account const&>::type
IssueAccount;
using IssueAccount = typename
std::conditional <ByValue, Account, Account const&>::type;
IssueCurrency currency;
IssueAccount account;
@@ -173,8 +171,8 @@ bool operator<= (IssueType <LhsByValue> const& lhs,
//------------------------------------------------------------------------------
typedef IssueType <true> Issue;
typedef IssueType <false> IssueRef;
using Issue = IssueType <true>;
using IssueRef = IssueType <false>;
//------------------------------------------------------------------------------

View File

@@ -78,8 +78,8 @@ public:
};
private:
typedef std::map <std::string, Item*> NameMap;
typedef std::map <KeyType, Item*> TypeMap;
using NameMap = std::map <std::string, Item*>;
using TypeMap = std::map <KeyType, Item*>;
public:
/** Create the known formats object.

View File

@@ -69,7 +69,6 @@ using LedgerSeq = std::uint32_t;
*/
using TxID = uint256;
/** A transaction index. */
using TxSeq = std::uint32_t;
} // ripple

View File

@@ -86,7 +86,7 @@ class Quality
public:
// Type of the internal representation. Higher qualities
// have lower unsigned integer representations.
typedef std::uint64_t value_type;
using value_type = std::uint64_t;
private:
value_type m_value;

View File

@@ -40,7 +40,7 @@ namespace ripple {
class RippleAddress : private CBase58Data
{
private:
typedef enum
enum VersionEncoding
{
VER_NONE = 1,
VER_NODE_PUBLIC = 28,
@@ -50,7 +50,7 @@ private:
VER_ACCOUNT_PRIVATE = 34,
VER_FAMILY_GENERATOR = 41,
VER_FAMILY_SEED = 33,
} VersionEncoding;
};
bool mIsValid;

View File

@@ -60,8 +60,8 @@ public:
class SOTemplate
{
public:
typedef std::unique_ptr <SOElement const> value_type;
typedef std::vector <value_type> list_type;
using value_type = std::unique_ptr <SOElement const>;
using list_type = std::vector <value_type>;
/** Create an empty template.
After creating the template, call @ref push_back with the

View File

@@ -42,9 +42,9 @@ class STAmount
: public STBase
{
public:
typedef std::uint64_t mantissa_type;
typedef int exponent_type;
typedef std::pair <mantissa_type, exponent_type> rep;
using mantissa_type = std::uint64_t;
using exponent_type = int;
using rep = std::pair <mantissa_type, exponent_type>;
private:
Issue mIssue;

View File

@@ -29,7 +29,7 @@ class STBitString final
: public STBase
{
public:
typedef base_uint<Bits> BitString;
using BitString = base_uint<Bits>;
STBitString () = default;

View File

@@ -32,8 +32,8 @@ class STLedgerEntry final
public:
static char const* getCountedObjectName () { return "STLedgerEntry"; }
typedef std::shared_ptr<STLedgerEntry> pointer;
typedef const std::shared_ptr<STLedgerEntry>& ref;
using pointer = std::shared_ptr<STLedgerEntry>;
using ref = const std::shared_ptr<STLedgerEntry>&;
public:
STLedgerEntry (const Serializer & s, uint256 const& index);

View File

@@ -41,8 +41,8 @@ class STTx final
public:
static char const* getCountedObjectName () { return "STTx"; }
typedef std::shared_ptr<STTx> pointer;
typedef const std::shared_ptr<STTx>& ref;
using pointer = std::shared_ptr<STTx>;
using ref = const std::shared_ptr<STTx>&;
static std::size_t const maxMultiSigners = 8;

View File

@@ -37,8 +37,8 @@ class STValidation final
public:
static char const* getCountedObjectName () { return "STValidation"; }
typedef std::shared_ptr<STValidation> pointer;
typedef const std::shared_ptr<STValidation>& ref;
using pointer = std::shared_ptr<STValidation>;
using ref = const std::shared_ptr<STValidation>&;
enum
{

View File

@@ -35,19 +35,19 @@ class NodeIDTag {};
/** Directory is an index into the directory of offer books.
The last 64 bits of this are the quality. */
typedef base_uint<256, detail::DirectoryTag> Directory;
using Directory = base_uint<256, detail::DirectoryTag>;
/** Account is a hash representing a specific account. */
typedef base_uint<160, detail::AccountTag> Account;
using Account = base_uint<160, detail::AccountTag>;
/** Currency is a hash representing a specific currency. */
typedef base_uint<160, detail::CurrencyTag> Currency;
using Currency = base_uint<160, detail::CurrencyTag>;
/** NodeID is a 160-bit hash representing one node. */
typedef base_uint<160, detail::NodeIDTag> NodeID;
using NodeID = base_uint<160, detail::NodeIDTag>;
typedef hash_set<Currency> CurrencySet;
typedef hash_set<NodeID> NodeIDSet;
using CurrencySet = hash_set<Currency>;
using NodeIDSet = hash_set<NodeID>;
/** A special account that's used as the "issuer" for XRP. */
Account const& xrpAccount();

View File

@@ -42,7 +42,7 @@ namespace detail {
class ErrorCategory
{
public:
using Map = std::unordered_map <error_code_i, ErrorInfo> ;
using Map = std::unordered_map <error_code_i, ErrorInfo>;
ErrorCategory ()
: m_unknown (rpcUNKNOWN, "unknown", "An unknown error code.")

View File

@@ -355,8 +355,8 @@ Account RippleAddress::getAccountID () const
}
}
typedef std::mutex StaticLockType;
typedef std::lock_guard <StaticLockType> StaticScopedLockType;
using StaticLockType = std::mutex;
using StaticScopedLockType = std::lock_guard <StaticLockType>;
static StaticLockType s_lock;
static hash_map <Blob, std::string> rncMapOld, rncMapNew;

View File

@@ -39,7 +39,7 @@ SField::IsSigning const SField::notSigning;
int SField::num = 0;
typedef std::lock_guard <std::mutex> StaticScopedLockType;
using StaticScopedLockType = std::lock_guard <std::mutex>;
// Give this translation unit only, permission to construct SFields
struct SField::make

View File

@@ -131,7 +131,7 @@ public:
STAmount const amount = amountFromString (issue, value);
expect (amount.getText () == value, "format " + value);
}
catch (std::exception const& e)
catch (std::exception const&)
{
expect (!success, "parse " + value + " should fail");
}