mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Improvements to STParsedJSON:
* Cleanups and reduction of copying * Add STArray::back, operator[], push_back(&&) * Add make_stvar * Rework STParsedJSON * Fix code and unit tests that use STParsedJSON * STTx move constructor
This commit is contained in:
@@ -88,7 +88,14 @@ public:
|
||||
STBase const& operator*() const { return get(); }
|
||||
STBase const* operator->() const { return &get(); }
|
||||
|
||||
template <class T, class... Args>
|
||||
friend
|
||||
STVar
|
||||
make_stvar(Args&&... args);
|
||||
|
||||
private:
|
||||
STVar() = default;
|
||||
|
||||
STVar (SerializedTypeID id, SField const& name);
|
||||
|
||||
void destroy();
|
||||
@@ -113,6 +120,16 @@ private:
|
||||
}
|
||||
};
|
||||
|
||||
template <class T, class... Args>
|
||||
inline
|
||||
STVar
|
||||
make_stvar(Args&&... args)
|
||||
{
|
||||
STVar st;
|
||||
st.construct<T>(std::forward<Args>(args)...);
|
||||
return std::move(st);
|
||||
}
|
||||
|
||||
inline
|
||||
bool
|
||||
operator== (STVar const& lhs, STVar const& rhs)
|
||||
|
||||
Reference in New Issue
Block a user