Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
Actor Framework
Commits
7373aef2
Commit
7373aef2
authored
Apr 03, 2013
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added `gval` (enforces lazy evaluation)
parent
b361e0e7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
cppa/guard_expr.hpp
cppa/guard_expr.hpp
+21
-0
No files found.
cppa/guard_expr.hpp
View file @
7373aef2
...
...
@@ -338,6 +338,14 @@ struct guard_placeholder {
};
template
<
typename
T
>
struct
ge_value
{
T
value
;
};
template
<
typename
T
>
ge_value
<
T
>
gval
(
T
val
)
{
return
{
std
::
move
(
val
)};
}
// result type computation
template
<
typename
T
,
class
Tuple
>
...
...
@@ -352,6 +360,9 @@ struct ge_unbound<std::reference_wrapper<T>, Tuple> { typedef T type; };
template
<
typename
T
,
class
Tuple
>
struct
ge_unbound
<
std
::
reference_wrapper
<
const
T
>
,
Tuple
>
{
typedef
T
type
;
};
template
<
typename
T
,
class
Tuple
>
struct
ge_unbound
<
ge_value
<
T
>
,
Tuple
>
{
typedef
T
type
;
};
// unbound type of placeholder
template
<
int
X
,
typename
...
Ts
>
struct
ge_unbound
<
guard_placeholder
<
X
>
,
detail
::
tdata
<
Ts
...
>
>
{
...
...
@@ -386,6 +397,11 @@ struct is_ge_type<guard_expr<OP, First, Second> > {
static
constexpr
bool
value
=
true
;
};
template
<
typename
T
>
struct
is_ge_type
<
ge_value
<
T
>>
{
static
constexpr
bool
value
=
true
;
};
template
<
operator_id
OP
,
typename
T1
,
typename
T2
>
guard_expr
<
OP
,
typename
detail
::
strip_and_convert
<
T1
>::
type
,
typename
detail
::
strip_and_convert
<
T2
>::
type
>
...
...
@@ -516,6 +532,11 @@ inline const T& ge_resolve(const Tuple&, const util::rebindable_reference<const
return
value
.
get
();
}
template
<
class
Tuple
,
typename
T
>
inline
const
T
&
ge_resolve
(
const
Tuple
&
,
const
ge_value
<
T
>&
wrapped_value
)
{
return
wrapped_value
.
value
;
}
template
<
class
Tuple
,
int
X
>
inline
auto
ge_resolve
(
const
Tuple
&
tup
,
guard_placeholder
<
X
>
)
->
decltype
(
get
<
X
>
(
tup
).
get
())
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment