Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
libcifpp
Overview
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
libcifpp
Commits
d50529c6
Commit
d50529c6
authored
Sep 21, 2020
by
Maarten L. Hekkelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactored cif::Key to work around weird g++ behaviour
parent
bb9d8161
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
64 additions
and
64 deletions
+64
-64
include/cif++/Cif++.hpp
+64
-64
No files found.
include/cif++/Cif++.hpp
View file @
d50529c6
...
...
@@ -1013,86 +1013,86 @@ struct Key
Key
(
const
Key
&
)
=
delete
;
Key
&
operator
=
(
const
Key
&
)
=
delete
;
template
<
typename
T
>
Condition
operator
==
(
const
T
&
v
)
const
{
return
Condition
(
new
detail
::
KeyIsConditionImpl
<
T
>
(
mItemTag
,
v
));
}
string
mItemTag
;
};
Condition
operator
==
(
const
char
*
v
)
const
{
string
value
(
v
?
v
:
""
);
return
Condition
(
new
detail
::
KeyIsConditionImpl
<
std
::
string
>
(
mItemTag
,
value
));
}
template
<
typename
T
>
Condition
operator
==
(
const
Key
&
key
,
const
T
&
v
)
{
return
Condition
(
new
detail
::
KeyIsConditionImpl
<
T
>
(
key
.
mItemTag
,
v
));
}
Condition
operator
==
(
const
detail
::
ItemReference
&
v
)
const
{
if
(
v
.
empty
())
return
Condition
(
new
detail
::
KeyIsEmptyConditionImpl
(
mItemTag
));
else
return
Condition
(
new
detail
::
KeyIsConditionImpl
<
std
::
string
>
(
mItemTag
,
v
.
c_str
()));
}
Condition
operator
==
(
const
Empty
&
)
const
{
return
Condition
(
new
detail
::
KeyIsEmptyConditionImpl
(
mItemTag
));
}
template
<
typename
T
>
Condition
operator
!=
(
const
T
&
v
)
const
{
return
Condition
(
new
detail
::
KeyIsNotConditionImpl
<
T
>
(
mItemTag
,
v
));
}
inline
Condition
operator
==
(
const
Key
&
key
,
const
char
*
v
)
{
string
value
(
v
?
v
:
""
);
return
Condition
(
new
detail
::
KeyIsConditionImpl
<
std
::
string
>
(
key
.
mItemTag
,
value
));
}
Condition
operator
!=
(
const
char
*
v
)
const
{
string
value
(
v
?
v
:
""
);
return
Condition
(
new
detail
::
KeyIsNotConditionImpl
<
std
::
string
>
(
mItemTag
,
value
));
}
inline
Condition
operator
==
(
const
Key
&
key
,
const
detail
::
ItemReference
&
v
)
{
if
(
v
.
empty
())
return
Condition
(
new
detail
::
KeyIsEmptyConditionImpl
(
key
.
mItemTag
));
else
return
Condition
(
new
detail
::
KeyIsConditionImpl
<
std
::
string
>
(
key
.
mItemTag
,
v
.
c_str
()));
}
template
<
typename
T
>
Condition
operator
>
(
const
T
&
v
)
const
{
return
Condition
(
new
detail
::
KeyCompareConditionImpl
(
mItemTag
,
[
this
,
v
](
const
Category
&
c
,
const
Row
&
r
)
{
return
r
[
this
->
mItemTag
].
as
<
T
>
()
>
v
;
}));
}
inline
Condition
operator
==
(
const
Key
&
key
,
const
Empty
&
)
{
return
Condition
(
new
detail
::
KeyIsEmptyConditionImpl
(
key
.
mItemTag
));
}
template
<
typename
T
>
Condition
operator
>=
(
const
T
&
v
)
const
{
return
Condition
(
new
detail
::
KeyCompareConditionImpl
(
mItemTag
,
[
this
,
v
](
const
Category
&
c
,
const
Row
&
r
)
{
return
r
[
this
->
mItemTag
].
as
<
T
>
()
>=
v
;
}));
}
template
<
typename
T
>
Condition
operator
!=
(
const
Key
&
key
,
const
T
&
v
)
{
return
Condition
(
new
detail
::
KeyIsNotConditionImpl
<
T
>
(
key
.
mItemTag
,
v
));
}
template
<
typename
T
>
Condition
operator
<
(
const
T
&
v
)
const
{
return
Condition
(
new
detail
::
KeyCompareConditionImpl
(
mItemTag
,
[
this
,
v
](
const
Category
&
c
,
const
Row
&
r
)
{
return
r
[
this
->
mItemTag
].
as
<
T
>
()
<
v
;
}));
}
inline
Condition
operator
!=
(
const
Key
&
key
,
const
char
*
v
)
{
string
value
(
v
?
v
:
""
);
return
Condition
(
new
detail
::
KeyIsNotConditionImpl
<
std
::
string
>
(
key
.
mItemTag
,
value
));
}
template
<
typename
T
>
Condition
operator
<=
(
const
T
&
v
)
const
{
return
Condition
(
new
detail
::
KeyCompareConditionImpl
(
mItemTag
,
[
this
,
v
](
const
Category
&
c
,
const
Row
&
r
)
{
return
r
[
this
->
mItemTag
].
as
<
T
>
()
<=
v
;
}));
}
string
mItemTag
;
};
template
<
typename
T
>
Condition
operator
>
(
const
Key
&
key
,
const
T
&
v
)
{
return
Condition
(
new
detail
::
KeyCompareConditionImpl
(
key
.
mItemTag
,
[
tag
=
key
.
mItemTag
,
v
](
const
Category
&
c
,
const
Row
&
r
)
{
return
r
[
tag
].
as
<
T
>
()
>
v
;
}));
}
template
<
typename
T
>
Condition
operator
>=
(
const
Key
&
key
,
const
T
&
v
)
{
return
Condition
(
new
detail
::
KeyCompareConditionImpl
(
key
.
mItemTag
,
[
tag
=
key
.
mItemTag
,
v
](
const
Category
&
c
,
const
Row
&
r
)
{
return
r
[
tag
].
as
<
T
>
()
>=
v
;
}));
}
template
<
typename
T
>
Condition
operator
<
(
const
Key
&
key
,
const
T
&
v
)
{
return
Condition
(
new
detail
::
KeyCompareConditionImpl
(
key
.
mItemTag
,
[
tag
=
key
.
mItemTag
,
v
](
const
Category
&
c
,
const
Row
&
r
)
{
return
r
[
tag
].
as
<
T
>
()
<
v
;
}));
}
template
<
typename
T
>
Condition
operator
<=
(
const
Key
&
key
,
const
T
&
v
)
{
return
Condition
(
new
detail
::
KeyCompareConditionImpl
(
key
.
mItemTag
,
[
tag
=
key
.
mItemTag
,
v
](
const
Category
&
c
,
const
Row
&
r
)
{
return
r
[
tag
].
as
<
T
>
()
<=
v
;
}));
}
template
<>
inline
Condition
Key
::
operator
==
(
const
std
::
regex
&
rx
)
const
Condition
operator
==
(
const
Key
&
key
,
const
std
::
regex
&
rx
)
{
return
Condition
(
new
detail
::
KeyMatchesConditionImpl
(
mItemTag
,
rx
));
return
Condition
(
new
detail
::
KeyMatchesConditionImpl
(
key
.
mItemTag
,
rx
));
}
template
<>
inline
Condition
Key
::
operator
==
(
const
Empty
&
)
const
Condition
operator
==
(
const
Key
&
key
,
const
Empty
&
)
{
return
Condition
(
new
detail
::
KeyIsEmptyConditionImpl
(
mItemTag
));
return
Condition
(
new
detail
::
KeyIsEmptyConditionImpl
(
key
.
mItemTag
));
}
struct
any
...
...
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