Skip to content
This repository was archived by the owner on Jun 17, 2022. It is now read-only.

Commit de4f73d

Browse files
committed
Merge #36: Drop overloaded members
076c051 Drop overloaded members (MacroFake) Pull request description: This is taken from `https://github.com/bitcoin/bitcoin/pull/15975/commits/a844dbed0ff4bdba014052d7ee83cf6c41879fcb` This should be safe and sane, because: * The overloaded members construct temporary copies and pass them on as const UniValue&, which will need to be copied again. Future changes that want to disable UniValue copy constructors will be easier with those members removed. * UniValue constructors are not marked explicit and there are no plans to make them explicit, so this change should not make unrelated future changes harder. ACKs for top commit: fanquake: ACK 076c051 - did not test downstream. Tree-SHA512: db70fa0ad9bacb9b01063a18eada3dbc0908f014dc96e94752a66b680856a5833b9b1158790ee892b9b0edbf7511faa32866d5c944b183a8d1c71ddf0318c707
2 parents 0626532 + 076c051 commit de4f73d

File tree

1 file changed

+0
-56
lines changed

1 file changed

+0
-56
lines changed

include/univalue.h

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -83,66 +83,10 @@ class UniValue {
8383
bool isObject() const { return (typ == VOBJ); }
8484

8585
bool push_back(const UniValue& val);
86-
bool push_back(const std::string& val_) {
87-
UniValue tmpVal(VSTR, val_);
88-
return push_back(tmpVal);
89-
}
90-
bool push_back(const char *val_) {
91-
std::string s(val_);
92-
return push_back(s);
93-
}
94-
bool push_back(uint64_t val_) {
95-
UniValue tmpVal(val_);
96-
return push_back(tmpVal);
97-
}
98-
bool push_back(int64_t val_) {
99-
UniValue tmpVal(val_);
100-
return push_back(tmpVal);
101-
}
102-
bool push_back(bool val_) {
103-
UniValue tmpVal(val_);
104-
return push_back(tmpVal);
105-
}
106-
bool push_back(int val_) {
107-
UniValue tmpVal(val_);
108-
return push_back(tmpVal);
109-
}
110-
bool push_back(double val_) {
111-
UniValue tmpVal(val_);
112-
return push_back(tmpVal);
113-
}
11486
bool push_backV(const std::vector<UniValue>& vec);
11587

11688
void __pushKV(const std::string& key, const UniValue& val);
11789
bool pushKV(const std::string& key, const UniValue& val);
118-
bool pushKV(const std::string& key, const std::string& val_) {
119-
UniValue tmpVal(VSTR, val_);
120-
return pushKV(key, tmpVal);
121-
}
122-
bool pushKV(const std::string& key, const char *val_) {
123-
std::string _val(val_);
124-
return pushKV(key, _val);
125-
}
126-
bool pushKV(const std::string& key, int64_t val_) {
127-
UniValue tmpVal(val_);
128-
return pushKV(key, tmpVal);
129-
}
130-
bool pushKV(const std::string& key, uint64_t val_) {
131-
UniValue tmpVal(val_);
132-
return pushKV(key, tmpVal);
133-
}
134-
bool pushKV(const std::string& key, bool val_) {
135-
UniValue tmpVal(val_);
136-
return pushKV(key, tmpVal);
137-
}
138-
bool pushKV(const std::string& key, int val_) {
139-
UniValue tmpVal((int64_t)val_);
140-
return pushKV(key, tmpVal);
141-
}
142-
bool pushKV(const std::string& key, double val_) {
143-
UniValue tmpVal(val_);
144-
return pushKV(key, tmpVal);
145-
}
14690
bool pushKVs(const UniValue& obj);
14791

14892
std::string write(unsigned int prettyIndent = 0,

0 commit comments

Comments
 (0)