Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
capnproto
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
capnproto
Commits
34c2a169
Commit
34c2a169
authored
May 10, 2017
by
Kenton Varda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix old GCC build.
parent
9816a0a4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
8 deletions
+15
-8
one-of.h
c++/src/kj/one-of.h
+15
-8
No files found.
c++/src/kj/one-of.h
View file @
34c2a169
...
...
@@ -91,14 +91,10 @@ public:
}
template
<
uint
i
>
KJ_NORETURN
(
void
allHandled
())
{
// After a series of if/else blocks handling each variant of the OneOf, have the final else
// block call allHandled<n>() where n is the number of variants. This will fail to compile
// if new variants are added in the future.
static_assert
(
i
==
sizeof
...(
Variants
),
"new OneOf variants need to be handled here"
);
KJ_UNREACHABLE
;
}
KJ_NORETURN
(
void
allHandled
());
// After a series of if/else blocks handling each variant of the OneOf, have the final else
// block call allHandled<n>() where n is the number of variants. This will fail to compile
// if new variants are added in the future.
private
:
uint
tag
;
...
...
@@ -169,6 +165,17 @@ private:
}
};
template
<
typename
...
Variants
>
template
<
uint
i
>
void
OneOf
<
Variants
...
>::
allHandled
()
{
// After a series of if/else blocks handling each variant of the OneOf, have the final else
// block call allHandled<n>() where n is the number of variants. This will fail to compile
// if new variants are added in the future.
static_assert
(
i
==
sizeof
...(
Variants
),
"new OneOf variants need to be handled here"
);
KJ_UNREACHABLE
;
}
}
// namespace kj
#endif // KJ_ONE_OF_H_
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