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
43fae7c5
Commit
43fae7c5
authored
Sep 21, 2017
by
Erik Murphy-Chutorian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid MSVC workaround in parse/common.h for clang. Fixes capnproto/capnproto#559
parent
73a01874
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
common.h
c++/src/kj/parse/common.h
+6
-6
No files found.
c++/src/kj/parse/common.h
View file @
43fae7c5
...
@@ -45,7 +45,7 @@
...
@@ -45,7 +45,7 @@
#include "../array.h"
#include "../array.h"
#include "../tuple.h"
#include "../tuple.h"
#include "../vector.h"
#include "../vector.h"
#if _MSC_VER
#if _MSC_VER
&& !__clang__
#include <type_traits> // result_of_t
#include <type_traits> // result_of_t
#endif
#endif
...
@@ -104,7 +104,7 @@ template <typename T> struct OutputType_;
...
@@ -104,7 +104,7 @@ template <typename T> struct OutputType_;
template
<
typename
T
>
struct
OutputType_
<
Maybe
<
T
>>
{
typedef
T
Type
;
};
template
<
typename
T
>
struct
OutputType_
<
Maybe
<
T
>>
{
typedef
T
Type
;
};
template
<
typename
Parser
,
typename
Input
>
template
<
typename
Parser
,
typename
Input
>
using
OutputType
=
typename
OutputType_
<
using
OutputType
=
typename
OutputType_
<
#if _MSC_VER
#if _MSC_VER
&& !__clang__
std
::
result_of_t
<
Parser
(
Input
)
>
std
::
result_of_t
<
Parser
(
Input
)
>
// The instance<T&>() based version below results in:
// The instance<T&>() based version below results in:
// C2064: term does not evaluate to a function taking 1 arguments
// C2064: term does not evaluate to a function taking 1 arguments
...
@@ -162,7 +162,7 @@ private:
...
@@ -162,7 +162,7 @@ private:
};
};
template
<
typename
ParserImpl
>
template
<
typename
ParserImpl
>
struct
WrapperImplInstance
{
struct
WrapperImplInstance
{
#if _MSC_VER
#if _MSC_VER
&& !__clang__
// TODO(msvc): MSVC currently fails to initialize vtable pointers for constexpr values so
// TODO(msvc): MSVC currently fails to initialize vtable pointers for constexpr values so
// we have to make this just const instead.
// we have to make this just const instead.
static
const
WrapperImpl
<
ParserImpl
>
instance
;
static
const
WrapperImpl
<
ParserImpl
>
instance
;
...
@@ -177,7 +177,7 @@ private:
...
@@ -177,7 +177,7 @@ private:
template
<
typename
Input
,
typename
Output
>
template
<
typename
Input
,
typename
Output
>
template
<
typename
ParserImpl
>
template
<
typename
ParserImpl
>
#if _MSC_VER
#if _MSC_VER
&& !__clang__
const
typename
ParserRef
<
Input
,
Output
>::
template
WrapperImpl
<
ParserImpl
>
const
typename
ParserRef
<
Input
,
Output
>::
template
WrapperImpl
<
ParserImpl
>
ParserRef
<
Input
,
Output
>::
WrapperImplInstance
<
ParserImpl
>::
instance
=
WrapperImpl
<
ParserImpl
>
();
ParserRef
<
Input
,
Output
>::
WrapperImplInstance
<
ParserImpl
>::
instance
=
WrapperImpl
<
ParserImpl
>
();
#else
#else
...
@@ -332,7 +332,7 @@ public:
...
@@ -332,7 +332,7 @@ public:
template
<
typename
Input
>
template
<
typename
Input
>
auto
operator
()(
Input
&
input
)
const
auto
operator
()(
Input
&
input
)
const
#if
ndef _MSC_VER
#if
!_MSC_VER || __clang__
->
Maybe
<
decltype
(
tuple
(
->
Maybe
<
decltype
(
tuple
(
instance
<
OutputType
<
FirstSubParser
,
Input
>>
(),
instance
<
OutputType
<
FirstSubParser
,
Input
>>
(),
instance
<
OutputType
<
SubParsers
,
Input
>>
()...))
>
instance
<
OutputType
<
SubParsers
,
Input
>>
()...))
>
...
@@ -343,7 +343,7 @@ public:
...
@@ -343,7 +343,7 @@ public:
template
<
typename
Input
,
typename
...
InitialParams
>
template
<
typename
Input
,
typename
...
InitialParams
>
auto
parseNext
(
Input
&
input
,
InitialParams
&&
...
initialParams
)
const
auto
parseNext
(
Input
&
input
,
InitialParams
&&
...
initialParams
)
const
#if
ndef _MSC_VER
#if
!_MSC_VER || __clang__
->
Maybe
<
decltype
(
tuple
(
->
Maybe
<
decltype
(
tuple
(
kj
::
fwd
<
InitialParams
>
(
initialParams
)...,
kj
::
fwd
<
InitialParams
>
(
initialParams
)...,
instance
<
OutputType
<
FirstSubParser
,
Input
>>
(),
instance
<
OutputType
<
FirstSubParser
,
Input
>>
(),
...
...
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