Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
CMake
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mattias Ellert
CMake
Commits
7ffa6bf9
Commit
7ffa6bf9
authored
6 years ago
by
wahikihiki
Browse files
Options
Downloads
Patches
Plain Diff
cmUVHandlePtr: Use inherited constructors
parent
b95b935c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Source/cmUVHandlePtr.h
+24
-15
24 additions, 15 deletions
Source/cmUVHandlePtr.h
with
24 additions
and
15 deletions
Source/cmUVHandlePtr.h
+
24
−
15
View file @
7ffa6bf9
...
...
@@ -3,7 +3,6 @@
#pragma once
#include
"cmConfigure.h"
// IWYU pragma: keep
#include
<algorithm>
#include
<cstddef>
#include
<cstdint>
#include
<memory>
...
...
@@ -11,12 +10,22 @@
#include
"cm_uv.h"
#define CM_PERFECT_FWD_CTOR(Class, FwdTo) \
template <typename... Args> \
Class(Args&&... args) \
: FwdTo(std::forward<Args>(args)...) \
{ \
}
#if defined(__SUNPRO_CC)
# include <utility>
# define CM_INHERIT_CTOR(Class, Base, Tpl) \
template <typename... Args> \
Class(Args&&... args) \
: Base Tpl(std::forward<Args>(args)...) \
{ \
}
#else
# define CM_INHERIT_CTOR(Class, Base, Tpl) using Base Tpl ::Base;
#endif
namespace
cm
{
...
...
@@ -116,7 +125,7 @@ class uv_handle_ptr_ : public uv_handle_ptr_base_<T>
friend
class
uv_handle_ptr_
;
public:
CM_
PERFECT_FWD
_CTOR
(
uv_handle_ptr_
,
uv_handle_ptr_base_
<
T
>
);
CM_
INHERIT
_CTOR
(
uv_handle_ptr_
,
uv_handle_ptr_base_
,
<
T
>
);
/***
* Allow less verbose calling of uv_<T> functions
...
...
@@ -133,13 +142,13 @@ template <>
class
uv_handle_ptr_
<
uv_handle_t
>
:
public
uv_handle_ptr_base_
<
uv_handle_t
>
{
public:
CM_
PERFECT_FWD
_CTOR
(
uv_handle_ptr_
,
uv_handle_ptr_base_
<
uv_handle_t
>
);
CM_
INHERIT
_CTOR
(
uv_handle_ptr_
,
uv_handle_ptr_base_
,
<
uv_handle_t
>
);
};
class
uv_async_ptr
:
public
uv_handle_ptr_
<
uv_async_t
>
{
public:
CM_
PERFECT_FWD
_CTOR
(
uv_async_ptr
,
uv_handle_ptr_
<
uv_async_t
>
);
CM_
INHERIT
_CTOR
(
uv_async_ptr
,
uv_handle_ptr_
,
<
uv_async_t
>
);
int
init
(
uv_loop_t
&
loop
,
uv_async_cb
async_cb
,
void
*
data
=
nullptr
);
...
...
@@ -148,7 +157,7 @@ public:
struct
uv_signal_ptr
:
public
uv_handle_ptr_
<
uv_signal_t
>
{
CM_
PERFECT_FWD
_CTOR
(
uv_signal_ptr
,
uv_handle_ptr_
<
uv_signal_t
>
);
CM_
INHERIT
_CTOR
(
uv_signal_ptr
,
uv_handle_ptr_
,
<
uv_signal_t
>
);
int
init
(
uv_loop_t
&
loop
,
void
*
data
=
nullptr
);
...
...
@@ -159,7 +168,7 @@ struct uv_signal_ptr : public uv_handle_ptr_<uv_signal_t>
struct
uv_pipe_ptr
:
public
uv_handle_ptr_
<
uv_pipe_t
>
{
CM_
PERFECT_FWD
_CTOR
(
uv_pipe_ptr
,
uv_handle_ptr_
<
uv_pipe_t
>
);
CM_
INHERIT
_CTOR
(
uv_pipe_ptr
,
uv_handle_ptr_
,
<
uv_pipe_t
>
);
operator
uv_stream_t
*
()
const
;
...
...
@@ -168,7 +177,7 @@ struct uv_pipe_ptr : public uv_handle_ptr_<uv_pipe_t>
struct
uv_process_ptr
:
public
uv_handle_ptr_
<
uv_process_t
>
{
CM_
PERFECT_FWD
_CTOR
(
uv_process_ptr
,
uv_handle_ptr_
<
uv_process_t
>
);
CM_
INHERIT
_CTOR
(
uv_process_ptr
,
uv_handle_ptr_
,
<
uv_process_t
>
);
int
spawn
(
uv_loop_t
&
loop
,
uv_process_options_t
const
&
options
,
void
*
data
=
nullptr
);
...
...
@@ -176,7 +185,7 @@ struct uv_process_ptr : public uv_handle_ptr_<uv_process_t>
struct
uv_timer_ptr
:
public
uv_handle_ptr_
<
uv_timer_t
>
{
CM_
PERFECT_FWD
_CTOR
(
uv_timer_ptr
,
uv_handle_ptr_
<
uv_timer_t
>
);
CM_
INHERIT
_CTOR
(
uv_timer_ptr
,
uv_handle_ptr_
,
<
uv_timer_t
>
);
int
init
(
uv_loop_t
&
loop
,
void
*
data
=
nullptr
);
...
...
@@ -185,7 +194,7 @@ struct uv_timer_ptr : public uv_handle_ptr_<uv_timer_t>
struct
uv_tty_ptr
:
public
uv_handle_ptr_
<
uv_tty_t
>
{
CM_
PERFECT_FWD
_CTOR
(
uv_tty_ptr
,
uv_handle_ptr_
<
uv_tty_t
>
);
CM_
INHERIT
_CTOR
(
uv_tty_ptr
,
uv_handle_ptr_
,
<
uv_tty_t
>
);
operator
uv_stream_t
*
()
const
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment