mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-30 08:41:15 +00:00
LibCore: Invoke forward
from the global namespace inside C_OBJECT
If a class defines a method named `forward` itself, the compiler isn't able to differentiate between that method and (std::)forward.
This commit is contained in:
parent
fb83ceaf57
commit
b00d77eac8
Notes:
sideshowbarker
2024-07-17 06:45:52 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/b00d77eac8 Pull-request: https://github.com/SerenityOS/serenity/pull/16066 Reviewed-by: https://github.com/linusg ✅
|
@ -65,18 +65,18 @@ enum class TimerShouldFireWhenNotVisible {
|
|||
Yes
|
||||
};
|
||||
|
||||
#define C_OBJECT(klass) \
|
||||
public: \
|
||||
virtual StringView class_name() const override { return #klass##sv; } \
|
||||
template<typename Klass = klass, class... Args> \
|
||||
static NonnullRefPtr<klass> construct(Args&&... args) \
|
||||
{ \
|
||||
return adopt_ref(*new Klass(forward<Args>(args)...)); \
|
||||
} \
|
||||
template<typename Klass = klass, class... Args> \
|
||||
static ErrorOr<NonnullRefPtr<klass>> try_create(Args&&... args) \
|
||||
{ \
|
||||
return adopt_nonnull_ref_or_enomem(new (nothrow) Klass(forward<Args>(args)...)); \
|
||||
#define C_OBJECT(klass) \
|
||||
public: \
|
||||
virtual StringView class_name() const override { return #klass##sv; } \
|
||||
template<typename Klass = klass, class... Args> \
|
||||
static NonnullRefPtr<klass> construct(Args&&... args) \
|
||||
{ \
|
||||
return adopt_ref(*new Klass(::forward<Args>(args)...)); \
|
||||
} \
|
||||
template<typename Klass = klass, class... Args> \
|
||||
static ErrorOr<NonnullRefPtr<klass>> try_create(Args&&... args) \
|
||||
{ \
|
||||
return adopt_nonnull_ref_or_enomem(new (nothrow) Klass(::forward<Args>(args)...)); \
|
||||
}
|
||||
|
||||
#define C_OBJECT_ABSTRACT(klass) \
|
||||
|
|
Loading…
Reference in a new issue