aboutsummaryrefslogtreecommitdiff
path: root/src/univalue/include/univalue.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/univalue/include/univalue.h')
-rw-r--r--src/univalue/include/univalue.h9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/univalue/include/univalue.h b/src/univalue/include/univalue.h
index ccaf56a271..6ef60b16e2 100644
--- a/src/univalue/include/univalue.h
+++ b/src/univalue/include/univalue.h
@@ -20,10 +20,7 @@ public:
enum VType { VNULL, VOBJ, VARR, VSTR, VNUM, VBOOL, };
UniValue() { typ = VNULL; }
- UniValue(UniValue::VType initialType, const std::string& initialStr = "") {
- typ = initialType;
- val = initialStr;
- }
+ UniValue(UniValue::VType type, std::string str = {}) : typ{type}, val{std::move(str)} {}
template <typename Ref, typename T = std::remove_cv_t<std::remove_reference_t<Ref>>,
std::enable_if_t<std::is_floating_point_v<T> || // setFloat
std::is_same_v<bool, T> || // setBool
@@ -49,12 +46,12 @@ public:
void setNull();
void setBool(bool val);
- void setNumStr(const std::string& val);
+ void setNumStr(std::string str);
void setInt(uint64_t val);
void setInt(int64_t val);
void setInt(int val_) { return setInt(int64_t{val_}); }
void setFloat(double val);
- void setStr(const std::string& val);
+ void setStr(std::string str);
void setArray();
void setObject();