Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
E
eigenpy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Stack Of Tasks
eigenpy
Commits
87a8f81a
Unverified
Commit
87a8f81a
authored
1 year ago
by
Joris Vaillant
Browse files
Options
Downloads
Patches
Plain Diff
core: Move is_class_or_union trait in utils/traits.hpp
parent
ab0496b8
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/eigenpy/utils/traits.hpp
+30
-0
30 additions, 0 deletions
include/eigenpy/utils/traits.hpp
include/eigenpy/variant.hpp
+1
-12
1 addition, 12 deletions
include/eigenpy/variant.hpp
with
31 additions
and
12 deletions
include/eigenpy/utils/traits.hpp
0 → 100644
+
30
−
0
View file @
87a8f81a
//
// Copyright (c) 2024 INRIA
//
//
#include
<type_traits>
#ifndef __eigenpy_utils_traits_hpp__
#define __eigenpy_utils_traits_hpp__
namespace
eigenpy
{
namespace
details
{
/// Trait to detect if T is a class or an union
template
<
typename
T
>
struct
is_class_or_union
:
std
::
integral_constant
<
bool
,
std
::
is_class
<
T
>::
value
||
std
::
is_union
<
T
>::
value
>
{};
/// Trait to remove cvref and call is_class_or_union
template
<
typename
T
>
struct
is_class_or_union_remove_cvref
:
is_class_or_union
<
typename
std
::
remove_cv
<
typename
std
::
remove_reference
<
T
>::
type
>::
type
>
{};
}
// namespace details
}
// namespace eigenpy
#endif // ifndef __eigenpy_utils_traits_hpp__
This diff is collapsed.
Click to expand it.
include/eigenpy/variant.hpp
+
1
−
12
View file @
87a8f81a
...
...
@@ -6,6 +6,7 @@
#define __eigenpy_utils_variant_hpp__
#include
"eigenpy/fwd.hpp"
#include
"eigenpy/utils/traits.hpp"
#include
<boost/python.hpp>
#include
<boost/variant.hpp>
...
...
@@ -204,18 +205,6 @@ struct VariantValueToObject : VariantVisitorType<PyObject*, Variant> {
using
Base
::
operator
();
};
/// Trait to detect if T is a class or an union
template
<
typename
T
>
struct
is_class_or_union
:
std
::
integral_constant
<
bool
,
std
::
is_class
<
T
>::
value
||
std
::
is_union
<
T
>::
value
>
{};
/// Trait to remove cvref and call is_class_or_union
template
<
typename
T
>
struct
is_class_or_union_remove_cvref
:
is_class_or_union
<
typename
std
::
remove_cv
<
typename
std
::
remove_reference
<
T
>::
type
>::
type
>
{};
/// Convert {boost,std}::variant<class...> alternative reference to a Python
/// object. This converter return the alternative reference. The code that
/// create the reference holder is taken from \see
...
...
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