mirror of
https://github.com/matrix-construct/construct
synced 2025-01-16 09:36:54 +01:00
ircd::js: Add uninitialized constructor for cheap object handle creation.
This commit is contained in:
parent
edd77d2265
commit
6cc89f2613
1 changed files with 8 additions and 1 deletions
|
@ -31,7 +31,7 @@ struct object
|
|||
:root<JSObject *, L>
|
||||
{
|
||||
IRCD_OVERLOAD(array)
|
||||
|
||||
IRCD_OVERLOAD(uninitialized)
|
||||
using handle = typename root<JSObject *, L>::handle;
|
||||
using handle_mutable = typename root<JSObject *, L>::handle_mutable;
|
||||
|
||||
|
@ -54,6 +54,7 @@ struct object
|
|||
object(const value<L> &);
|
||||
object(JSObject *const &);
|
||||
object(JSObject &);
|
||||
object(uninitialized_t);
|
||||
object();
|
||||
};
|
||||
|
||||
|
@ -85,6 +86,12 @@ IRCD_STRONG_TYPEDEF(uint, reserved)
|
|||
//
|
||||
namespace basic {
|
||||
|
||||
template<lifetime L>
|
||||
object<L>::object(uninitialized_t)
|
||||
:object<L>::root::type{}
|
||||
{
|
||||
}
|
||||
|
||||
template<lifetime L>
|
||||
object<L>::object()
|
||||
:object<L>::root::type
|
||||
|
|
Loading…
Reference in a new issue