Wildmeshing Toolkit
Loading...
Searching...
No Matches
variant_comparison.hpp
Go to the documentation of this file.
1
#pragma once
2
#include <
wmtk/attribute/MeshAttributeHandle.hpp
>
3
4
namespace
wmtk::attribute::utils
{
5
6
template
<
typename
T>
7
bool
variant_comparison
(
8
const
TypedAttributeHandle<T>
& a,
9
const
MeshAttributeHandle::HandleVariant
& var)
10
{
11
return
std::visit(
12
[&](
const
auto
& v)
noexcept
{
13
if
constexpr
(std::is_same_v<TypedAttributeHandle<T>, std::decay_t<
decltype
(v)>>) {
14
return
v == a;
15
16
}
else
{
17
return
false
;
18
}
19
},
20
var);
21
}
22
23
}
// namespace wmtk::attribute::utils
MeshAttributeHandle.hpp
wmtk::attribute::MeshAttributeHandle::HandleVariant
std::variant< TypedAttributeHandle< char >, TypedAttributeHandle< int64_t >, TypedAttributeHandle< double >, TypedAttributeHandle< wmtk::Rational > > HandleVariant
Definition
MeshAttributeHandle.hpp:38
wmtk::attribute::TypedAttributeHandle
Handle that represents attributes for some mesh.
Definition
TypedAttributeHandle.hpp:28
wmtk::attribute::utils
Definition
variant_comparison.hpp:4
wmtk::attribute::utils::variant_comparison
bool variant_comparison(const TypedAttributeHandle< T > &a, const MeshAttributeHandle::HandleVariant &var)
Definition
variant_comparison.hpp:7
src
wmtk
attribute
utils
variant_comparison.hpp
Generated by
1.9.8