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
f693e2e5
Commit
f693e2e5
authored
Sep 27, 2018
by
Kenton Varda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Try to fix MSVC.
parent
d0dea8e5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
19 deletions
+19
-19
common.h
c++/src/kj/common.h
+19
-19
No files found.
c++/src/kj/common.h
View file @
f693e2e5
...
@@ -870,7 +870,7 @@ class NullableValue {
...
@@ -870,7 +870,7 @@ class NullableValue {
// boolean flag indicating nullness.
// boolean flag indicating nullness.
public
:
public
:
inline
NullableValue
(
NullableValue
&&
other
)
noexcept
(
noexcept
(
T
(
instance
<
T
&&>
())))
inline
NullableValue
(
NullableValue
&&
other
)
:
isSet
(
other
.
isSet
)
{
:
isSet
(
other
.
isSet
)
{
if
(
isSet
)
{
if
(
isSet
)
{
ctor
(
value
,
kj
::
mv
(
other
.
value
));
ctor
(
value
,
kj
::
mv
(
other
.
value
));
...
@@ -922,8 +922,8 @@ public:
...
@@ -922,8 +922,8 @@ public:
return
value
;
return
value
;
}
}
inline
NullableValue
()
noexcept
:
isSet
(
false
)
{}
inline
NullableValue
()
:
isSet
(
false
)
{}
inline
NullableValue
(
T
&&
t
)
noexcept
(
noexcept
(
T
(
instance
<
T
&&>
())))
inline
NullableValue
(
T
&&
t
)
:
isSet
(
true
)
{
:
isSet
(
true
)
{
ctor
(
value
,
kj
::
mv
(
t
));
ctor
(
value
,
kj
::
mv
(
t
));
}
}
...
@@ -940,7 +940,7 @@ public:
...
@@ -940,7 +940,7 @@ public:
if
(
isSet
)
ctor
(
value
,
*
t
);
if
(
isSet
)
ctor
(
value
,
*
t
);
}
}
template
<
typename
U
>
template
<
typename
U
>
inline
NullableValue
(
NullableValue
<
U
>&&
other
)
noexcept
(
noexcept
(
T
(
instance
<
U
&&>
())))
inline
NullableValue
(
NullableValue
<
U
>&&
other
)
:
isSet
(
other
.
isSet
)
{
:
isSet
(
other
.
isSet
)
{
if
(
isSet
)
{
if
(
isSet
)
{
ctor
(
value
,
kj
::
mv
(
other
.
value
));
ctor
(
value
,
kj
::
mv
(
other
.
value
));
...
@@ -1106,16 +1106,16 @@ class Maybe {
...
@@ -1106,16 +1106,16 @@ class Maybe {
public
:
public
:
Maybe
()
:
ptr
(
nullptr
)
{}
Maybe
()
:
ptr
(
nullptr
)
{}
Maybe
(
T
&&
t
)
noexcept
(
noexcept
(
T
(
instance
<
T
&&>
())))
:
ptr
(
kj
::
mv
(
t
))
{}
Maybe
(
T
&&
t
)
:
ptr
(
kj
::
mv
(
t
))
{}
Maybe
(
T
&
t
)
:
ptr
(
t
)
{}
Maybe
(
T
&
t
)
:
ptr
(
t
)
{}
Maybe
(
const
T
&
t
)
:
ptr
(
t
)
{}
Maybe
(
const
T
&
t
)
:
ptr
(
t
)
{}
Maybe
(
const
T
*
t
)
noexcept
:
ptr
(
t
)
{}
Maybe
(
const
T
*
t
)
:
ptr
(
t
)
{}
Maybe
(
Maybe
&&
other
)
noexcept
(
noexcept
(
T
(
instance
<
T
&&>
())))
:
ptr
(
kj
::
mv
(
other
.
ptr
))
{}
Maybe
(
Maybe
&&
other
)
:
ptr
(
kj
::
mv
(
other
.
ptr
))
{}
Maybe
(
const
Maybe
&
other
)
:
ptr
(
other
.
ptr
)
{}
Maybe
(
const
Maybe
&
other
)
:
ptr
(
other
.
ptr
)
{}
Maybe
(
Maybe
&
other
)
:
ptr
(
other
.
ptr
)
{}
Maybe
(
Maybe
&
other
)
:
ptr
(
other
.
ptr
)
{}
template
<
typename
U
>
template
<
typename
U
>
Maybe
(
Maybe
<
U
>&&
other
)
noexcept
(
noexcept
(
T
(
instance
<
U
&&>
())))
{
Maybe
(
Maybe
<
U
>&&
other
)
{
KJ_IF_MAYBE
(
val
,
kj
::
mv
(
other
))
{
KJ_IF_MAYBE
(
val
,
kj
::
mv
(
other
))
{
ptr
.
emplace
(
kj
::
mv
(
*
val
));
ptr
.
emplace
(
kj
::
mv
(
*
val
));
}
}
...
@@ -1127,7 +1127,7 @@ public:
...
@@ -1127,7 +1127,7 @@ public:
}
}
}
}
Maybe
(
decltype
(
nullptr
))
noexcept
:
ptr
(
nullptr
)
{}
Maybe
(
decltype
(
nullptr
))
:
ptr
(
nullptr
)
{}
template
<
typename
...
Params
>
template
<
typename
...
Params
>
inline
T
&
emplace
(
Params
&&
...
params
)
{
inline
T
&
emplace
(
Params
&&
...
params
)
{
...
@@ -1252,22 +1252,22 @@ private:
...
@@ -1252,22 +1252,22 @@ private:
template
<
typename
T
>
template
<
typename
T
>
class
Maybe
<
T
&>:
public
DisallowConstCopyIfNotConst
<
T
>
{
class
Maybe
<
T
&>:
public
DisallowConstCopyIfNotConst
<
T
>
{
public
:
public
:
Maybe
()
noexcept
:
ptr
(
nullptr
)
{}
Maybe
()
:
ptr
(
nullptr
)
{}
Maybe
(
T
&
t
)
noexcept
:
ptr
(
&
t
)
{}
Maybe
(
T
&
t
)
:
ptr
(
&
t
)
{}
Maybe
(
T
*
t
)
noexcept
:
ptr
(
t
)
{}
Maybe
(
T
*
t
)
:
ptr
(
t
)
{}
template
<
typename
U
>
template
<
typename
U
>
inline
Maybe
(
Maybe
<
U
&>&
other
)
noexcept
:
ptr
(
other
.
ptr
)
{}
inline
Maybe
(
Maybe
<
U
&>&
other
)
:
ptr
(
other
.
ptr
)
{}
template
<
typename
U
>
template
<
typename
U
>
inline
Maybe
(
const
Maybe
<
U
&>&
other
)
noexcept
:
ptr
(
const_cast
<
const
U
*>
(
other
.
ptr
))
{}
inline
Maybe
(
const
Maybe
<
U
&>&
other
)
:
ptr
(
const_cast
<
const
U
*>
(
other
.
ptr
))
{}
inline
Maybe
(
decltype
(
nullptr
))
noexcept
:
ptr
(
nullptr
)
{}
inline
Maybe
(
decltype
(
nullptr
))
:
ptr
(
nullptr
)
{}
inline
Maybe
&
operator
=
(
T
&
other
)
noexcept
{
ptr
=
&
other
;
return
*
this
;
}
inline
Maybe
&
operator
=
(
T
&
other
)
{
ptr
=
&
other
;
return
*
this
;
}
inline
Maybe
&
operator
=
(
T
*
other
)
noexcept
{
ptr
=
other
;
return
*
this
;
}
inline
Maybe
&
operator
=
(
T
*
other
)
{
ptr
=
other
;
return
*
this
;
}
template
<
typename
U
>
template
<
typename
U
>
inline
Maybe
&
operator
=
(
Maybe
<
U
&>&
other
)
noexcept
{
ptr
=
other
.
ptr
;
return
*
this
;
}
inline
Maybe
&
operator
=
(
Maybe
<
U
&>&
other
)
{
ptr
=
other
.
ptr
;
return
*
this
;
}
template
<
typename
U
>
template
<
typename
U
>
inline
Maybe
&
operator
=
(
const
Maybe
<
const
U
&>&
other
)
noexcept
{
ptr
=
other
.
ptr
;
return
*
this
;
}
inline
Maybe
&
operator
=
(
const
Maybe
<
const
U
&>&
other
)
{
ptr
=
other
.
ptr
;
return
*
this
;
}
inline
bool
operator
==
(
decltype
(
nullptr
))
const
{
return
ptr
==
nullptr
;
}
inline
bool
operator
==
(
decltype
(
nullptr
))
const
{
return
ptr
==
nullptr
;
}
inline
bool
operator
!=
(
decltype
(
nullptr
))
const
{
return
ptr
!=
nullptr
;
}
inline
bool
operator
!=
(
decltype
(
nullptr
))
const
{
return
ptr
!=
nullptr
;
}
...
...
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