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
433beae7
Commit
433beae7
authored
Dec 09, 2014
by
Joseph Noir
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add + operator for time_point
parent
59b0bb35
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
libcaf_core/caf/chrono.hpp
libcaf_core/caf/chrono.hpp
+8
-0
No files found.
libcaf_core/caf/chrono.hpp
View file @
433beae7
...
...
@@ -43,6 +43,8 @@ class time_point {
public:
inline
time_point
()
:
m_handle
{
0
,
0
}
{
}
inline
time_point
(
uint32_t
seconds
,
uint32_t
microseconds
)
:
m_handle
{
seconds
,
microseconds
}
{
adjust_overhead
();
}
inline
time_point
(
timex_t
&&
tp
)
:
m_handle
(
tp
)
{
}
constexpr
time_point
(
const
time_point
&
tp
)
=
default
;
constexpr
time_point
(
time_point
&&
tp
)
=
default
;
...
...
@@ -59,6 +61,12 @@ class time_point {
adjust_overhead
();
return
*
this
;
}
template
<
class
Rep
,
class
Period
>
inline
time_point
operator
+
(
const
std
::
chrono
::
duration
<
Rep
,
Period
>&
d
)
{
time_point
result
{
seconds
(),
microseconds
()};
result
+=
d
;
return
result
;
}
inline
uint32_t
seconds
()
const
{
return
m_handle
.
seconds
;
}
inline
uint32_t
microseconds
()
const
{
return
m_handle
.
microseconds
;
}
...
...
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