Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs-feliks
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Feliks Kiszkurno
ogs-feliks
Commits
6b9b2c5b
Commit
6b9b2c5b
authored
9 months ago
by
Christoph Lehmann
Browse files
Options
Downloads
Patches
Plain Diff
[PL] Use Boost::Mp11 type aliases
parent
4fcc1f94
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
ProcessLib/Graph/Apply.h
+2
-2
2 additions, 2 deletions
ProcessLib/Graph/Apply.h
ProcessLib/Graph/Get.h
+4
-12
4 additions, 12 deletions
ProcessLib/Graph/Get.h
ProcessLib/Reflection/ReflectionIPData.h
+6
-4
6 additions, 4 deletions
ProcessLib/Reflection/ReflectionIPData.h
with
12 additions
and
18 deletions
ProcessLib/Graph/Apply.h
+
2
−
2
View file @
6b9b2c5b
...
...
@@ -229,14 +229,14 @@ auto applyImpl(Function&& f, Args&&... args) ->
mp_transform
<
std
::
remove_cvref_t
,
FlattenedTuple
>
;
static_assert
(
boost
::
mp11
::
mp_is_set
<
FlattenedTupleOfPlainTypes
>
::
value
,
mp_is_set
_v
<
FlattenedTupleOfPlainTypes
>
,
"The types of all elements of all passed tuples must be unique."
);
using
FunctionArgumentTypesPlain
=
typename
detail
::
GetFunctionArgumentTypesPlain
<
FunctionPlain
>::
type
;
static_assert
(
boost
::
mp11
::
mp_is_set
<
FunctionArgumentTypesPlain
>
::
value
,
mp_is_set
_v
<
FunctionArgumentTypesPlain
>
,
"The argument types of the function to be called must be unique."
);
return
unpackAndInvoke
(
FunctionArgumentTypesPlain
{},
...
...
This diff is collapsed.
Click to expand it.
ProcessLib/Graph/Get.h
+
4
−
12
View file @
6b9b2c5b
...
...
@@ -11,6 +11,8 @@
#include
<boost/mp11.hpp>
#include
"BaseLib/BoostMP11Utils.h"
namespace
ProcessLib
::
Graph
{
namespace
detail
...
...
@@ -43,16 +45,6 @@ struct GetFlattenedTupleTypes
using
type
=
boost
::
mp11
::
mp_flatten
<
std
::
tuple
<
Tuples
...
>>
;
};
// Alias to be used together with static_assert to improve possible compile
// error messages.
template
<
typename
List
,
typename
Elem
>
constexpr
bool
mp_contains_v
=
boost
::
mp11
::
mp_contains
<
List
,
Elem
>::
value
;
// Alias to be used together with static_assert to improve possible compile
// error messages
template
<
typename
Set
>
constexpr
bool
mp_is_set_v
=
boost
::
mp11
::
mp_is_set
<
Set
>::
value
;
}
// namespace detail
/// Type-based access of an element of any of the passed tuples.
...
...
@@ -77,10 +69,10 @@ auto& get(Tuples&... ts)
mp_transform
<
std
::
remove_cvref_t
,
FlattenedTuple
>
;
static_assert
(
detail
::
mp_is_set_v
<
FlattenedTupleOfPlainTypes
>
,
mp_is_set_v
<
FlattenedTupleOfPlainTypes
>
,
"The types of all elements of all passed tuples must be unique."
);
static_assert
(
detail
::
mp_contains_v
<
FlattenedTupleOfPlainTypes
,
T
>
,
static_assert
(
mp_contains_v
<
FlattenedTupleOfPlainTypes
,
T
>
,
"Type T must be inside any of the passed tuples."
);
return
detail
::
getImpl
<
T
>
(
ts
...);
...
...
This diff is collapsed.
Click to expand it.
ProcessLib/Reflection/ReflectionIPData.h
+
6
−
4
View file @
6b9b2c5b
...
...
@@ -12,6 +12,7 @@
#include
<boost/mp11.hpp>
#include
"BaseLib/BoostMP11Utils.h"
#include
"BaseLib/StrongType.h"
#include
"MathLib/KelvinVector.h"
#include
"ReflectionData.h"
...
...
@@ -113,7 +114,7 @@ auto reflect(std::type_identity<std::tuple<Ts...>>)
// The types Ts... must be unique. Duplicate types are incompatible with the
// concept of "reflected" I/O: they would lead to duplicate names for the
// I/O data.
static_assert
(
mp_is_set
<
mp_list
<
Ts
...
>>
::
value
);
static_assert
(
mp_is_set
_v
<
mp_list
<
Ts
...
>>
);
return
reflectWithoutName
<
std
::
tuple
<
Ts
...
>>
(
[](
auto
&
tuple_
)
->
auto
&
{
return
std
::
get
<
Ts
>
(
tuple_
);
}...);
...
...
@@ -462,9 +463,10 @@ void forEachReflectedFlattenedIPDataAccessor(ReflData const& reflection_data,
// AccessorResult must be a std::vector<SomeType, SomeAllocator>. We
// check that, now.
static_assert
(
boost
::
mp11
::
mp_is_list
<
AccessorResult
>::
value
);
// std::vector<SomeType, SomeAllocator>
// is a list in the Boost MP11 sense
static_assert
(
mp_is_list_v
<
AccessorResult
>
);
// std::vector<SomeType,
// SomeAllocator> is a list in
// the Boost MP11 sense
static_assert
(
std
::
is_same_v
<
AccessorResult
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment