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
3a184591
Commit
3a184591
authored
Jun 16, 2018
by
Kenton Varda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Work around VS2015 bug with zero-arg default constructors.
parent
b03be9a3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
5 deletions
+13
-5
common.h
c++/src/kj/common.h
+8
-0
table.h
c++/src/kj/table.h
+2
-2
tuple.h
c++/src/kj/tuple.h
+3
-3
No files found.
c++/src/kj/common.h
View file @
3a184591
...
...
@@ -303,6 +303,14 @@ KJ_NORETURN(void unreachable());
#define KJ_CONSTEXPR(...) constexpr
#endif
#if defined(_MSC_VER) && _MSC_VER < 1910
// TODO(msvc): Visual Studio 2015 mishandles declaring the no-arg constructor `= default` for
// certain template types -- it fails to call member constructors.
#define KJ_DEFAULT_CONSTRUCTOR_VS2015_BUGGY {}
#else
#define KJ_DEFAULT_CONSTRUCTOR_VS2015_BUGGY = default;
#endif
// =======================================================================================
// Template metaprogramming helpers.
...
...
c++/src/kj/table.h
View file @
3a184591
...
...
@@ -761,7 +761,7 @@ kj::Array<HashBucket> rehash(kj::ArrayPtr<const HashBucket> oldBuckets, size_t t
template
<
typename
Callbacks
>
class
HashIndex
{
public
:
HashIndex
()
=
default
;
HashIndex
()
KJ_DEFAULT_CONSTRUCTOR_VS2015_BUGGY
template
<
typename
...
Params
>
HashIndex
(
Params
&&
...
params
)
:
cb
(
kj
::
fwd
<
Params
>
(
params
)...)
{}
...
...
@@ -1299,7 +1299,7 @@ inline BTreeImpl::Iterator BTreeImpl::end() const {
template
<
typename
Callbacks
>
class
TreeIndex
{
public
:
TreeIndex
()
=
default
;
TreeIndex
()
KJ_DEFAULT_CONSTRUCTOR_VS2015_BUGGY
template
<
typename
...
Params
>
TreeIndex
(
Params
&&
...
params
)
:
cb
(
kj
::
fwd
<
Params
>
(
params
)...)
{}
...
...
c++/src/kj/tuple.h
View file @
3a184591
...
...
@@ -93,7 +93,7 @@ struct TupleElement {
// from a TupleElement for each element, which is more efficient than a recursive definition.
T
value
;
TupleElement
()
=
default
;
TupleElement
()
KJ_DEFAULT_CONSTRUCTOR_VS2015_BUGGY
constexpr
inline
TupleElement
(
const
T
&
value
)
:
value
(
value
)
{}
constexpr
inline
TupleElement
(
T
&&
value
)
:
value
(
kj
::
mv
(
value
))
{}
};
...
...
@@ -123,7 +123,7 @@ struct TupleImpl<Indexes<indexes...>, Types...>
static_assert
(
sizeof
...(
indexes
)
==
sizeof
...(
Types
),
"Incorrect use of TupleImpl."
);
TupleImpl
()
=
default
;
TupleImpl
()
KJ_DEFAULT_CONSTRUCTOR_VS2015_BUGGY
template
<
typename
...
Params
>
inline
TupleImpl
(
Params
&&
...
params
)
...
...
@@ -153,7 +153,7 @@ class Tuple {
// The actual Tuple class (used for tuples of size other than 1).
public
:
Tuple
()
=
default
;
Tuple
()
KJ_DEFAULT_CONSTRUCTOR_VS2015_BUGGY
template
<
typename
...
U
>
constexpr
inline
Tuple
(
Tuple
<
U
...
>&&
other
)
:
impl
(
kj
::
mv
(
other
))
{}
...
...
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