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
19096841
Commit
19096841
authored
Mar 10, 2016
by
Harris Hancock
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Work around spurious MSVC noexcept dtor compile error
parent
4e178217
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
common.h
c++/src/kj/common.h
+10
-1
No files found.
c++/src/kj/common.h
View file @
19096841
...
@@ -794,6 +794,15 @@ class Maybe;
...
@@ -794,6 +794,15 @@ class Maybe;
namespace
_
{
// private
namespace
_
{
// private
#if _MSC_VER
// TODO(msvc): MSVC barfs on noexcept(instance<T&>().~T()) where T = kj::Exception and
// kj::_::Void. It and every other factorization I've tried produces:
// error C2325: 'kj::Blah' unexpected type to the right of '.~': expected 'void'
#define MSVC_NOEXCEPT_DTOR_WORKAROUND(T) __is_nothrow_destructible(T)
#else
#define MSVC_NOEXCEPT_DTOR_WORKAROUND(T) noexcept(instance<T&>().~T())
#endif
template
<
typename
T
>
template
<
typename
T
>
class
NullableValue
{
class
NullableValue
{
// Class whose interface behaves much like T*, but actually contains an instance of T and a
// Class whose interface behaves much like T*, but actually contains an instance of T and a
...
@@ -818,7 +827,7 @@ public:
...
@@ -818,7 +827,7 @@ public:
ctor
(
value
,
other
.
value
);
ctor
(
value
,
other
.
value
);
}
}
}
}
inline
~
NullableValue
()
noexcept
(
noexcept
(
instance
<
T
&>
().
~
T
()
))
{
inline
~
NullableValue
()
noexcept
(
MSVC_NOEXCEPT_DTOR_WORKAROUND
(
T
))
{
if
(
isSet
)
{
if
(
isSet
)
{
dtor
(
value
);
dtor
(
value
);
}
}
...
...
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