Skip to content

Commit

Permalink
Merge bitcoin#11: Remove deprecated std pair wrappers
Browse files Browse the repository at this point in the history
85052a4 Remove deprecated std::pair wrappers (Karel Bilek)

Pull request description:

  These are deprecated and no longer used in Bitcoin Core.

Tree-SHA512: 774c9b84f88e0c5e2062b3d7f03399d9909830d044bc3cf8dfcd45e58f48072ce527f471360cb36594e898e625d965b71436559bff2bb4b368255b9f1e26f722
  • Loading branch information
laanwj committed Sep 7, 2018
2 parents 40e3485 + 85052a4 commit 7890db9
Showing 1 changed file with 0 additions and 68 deletions.
68 changes: 0 additions & 68 deletions include/univalue.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include <cassert>

#include <sstream> // .get_int64()
#include <utility> // std::pair

class UniValue {
public:
Expand Down Expand Up @@ -177,76 +176,9 @@ class UniValue {
const UniValue& get_array() const;

enum VType type() const { return getType(); }
bool push_back(std::pair<std::string,UniValue> pear) {
return pushKV(pear.first, pear.second);
}
friend const UniValue& find_value( const UniValue& obj, const std::string& name);
};

//
// The following were added for compatibility with json_spirit.
// Most duplicate other methods, and should be removed.
//
static inline std::pair<std::string,UniValue> Pair(const char *cKey, const char *cVal)
{
std::string key(cKey);
UniValue uVal(cVal);
return std::make_pair(key, uVal);
}

static inline std::pair<std::string,UniValue> Pair(const char *cKey, std::string strVal)
{
std::string key(cKey);
UniValue uVal(strVal);
return std::make_pair(key, uVal);
}

static inline std::pair<std::string,UniValue> Pair(const char *cKey, uint64_t u64Val)
{
std::string key(cKey);
UniValue uVal(u64Val);
return std::make_pair(key, uVal);
}

static inline std::pair<std::string,UniValue> Pair(const char *cKey, int64_t i64Val)
{
std::string key(cKey);
UniValue uVal(i64Val);
return std::make_pair(key, uVal);
}

static inline std::pair<std::string,UniValue> Pair(const char *cKey, bool iVal)
{
std::string key(cKey);
UniValue uVal(iVal);
return std::make_pair(key, uVal);
}

static inline std::pair<std::string,UniValue> Pair(const char *cKey, int iVal)
{
std::string key(cKey);
UniValue uVal(iVal);
return std::make_pair(key, uVal);
}

static inline std::pair<std::string,UniValue> Pair(const char *cKey, double dVal)
{
std::string key(cKey);
UniValue uVal(dVal);
return std::make_pair(key, uVal);
}

static inline std::pair<std::string,UniValue> Pair(const char *cKey, const UniValue& uVal)
{
std::string key(cKey);
return std::make_pair(key, uVal);
}

static inline std::pair<std::string,UniValue> Pair(std::string key, const UniValue& uVal)
{
return std::make_pair(key, uVal);
}

enum jtokentype {
JTOK_ERR = -1,
JTOK_NONE = 0, // eof
Expand Down

0 comments on commit 7890db9

Please sign in to comment.