mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Restrict access to the virtual functions move and copy
* These are meant to be used by detail::STVar only and are otherwise error-prone to call.
This commit is contained in:
committed by
Nik Bougalis
parent
74e6ed1af3
commit
0c13676d5f
@@ -33,6 +33,10 @@ namespace ripple {
|
||||
|
||||
enum class JsonOptions { none = 0, include_date = 1 };
|
||||
|
||||
namespace detail {
|
||||
class STVar;
|
||||
}
|
||||
|
||||
// VFALCO TODO fix this restriction on copy assignment.
|
||||
//
|
||||
// CAUTION: Do not create a vector (or similar container) of any object derived
|
||||
@@ -77,11 +81,6 @@ public:
|
||||
bool
|
||||
operator!=(const STBase& t) const;
|
||||
|
||||
virtual STBase*
|
||||
copy(std::size_t n, void* buf) const;
|
||||
virtual STBase*
|
||||
move(std::size_t n, void* buf);
|
||||
|
||||
template <class D>
|
||||
D&
|
||||
downcast();
|
||||
@@ -126,6 +125,14 @@ protected:
|
||||
template <class T>
|
||||
static STBase*
|
||||
emplace(std::size_t n, void* buf, T&& val);
|
||||
|
||||
private:
|
||||
virtual STBase*
|
||||
copy(std::size_t n, void* buf) const;
|
||||
virtual STBase*
|
||||
move(std::size_t n, void* buf);
|
||||
|
||||
friend class detail::STVar;
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user