Added operators to BoxedObject, fixed MappintIterator for reference types and fixed signature of custom assertion and error handlers.
This commit is contained in:
@@ -32,13 +32,14 @@ class BoxedObject
|
||||
{
|
||||
private:
|
||||
union {
|
||||
std::byte placeholder_;
|
||||
T object_;
|
||||
};
|
||||
#if MIJIN_BOXED_OBJECT_DEBUG
|
||||
bool constructed = false;
|
||||
#endif
|
||||
public:
|
||||
BoxedObject() = default;
|
||||
BoxedObject() noexcept : placeholder_() {};
|
||||
explicit BoxedObject(T object)
|
||||
#if MIJIN_BOXED_OBJECT_DEBUG
|
||||
: constructed(true)
|
||||
@@ -59,6 +60,11 @@ public:
|
||||
BoxedObject& operator=(const BoxedObject&) = delete;
|
||||
BoxedObject& operator=(BoxedObject&&) = delete;
|
||||
|
||||
T& operator*() noexcept { return get(); }
|
||||
const T& operator*() const noexcept { return get(); }
|
||||
T* operator->() noexcept { return &get(); }
|
||||
const T* operator->() const noexcept { return &get(); }
|
||||
|
||||
template<typename... TArgs>
|
||||
void construct(TArgs&&... args)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user