DOLFINx 0.8.0
DOLFINx C++ interface
Loading...
Searching...
No Matches
types.h
1// Copyright (C) 2023 Garth N. Wells
2//
3// This file is part of DOLFINx (https://www.fenicsproject.org)
4//
5// SPDX-License-Identifier: LGPL-3.0-or-later
6
7#pragma once
8
9#include <complex>
10#include <concepts>
11#include <type_traits>
12
13namespace dolfinx
14{
18template <class T>
19concept scalar
20 = std::is_floating_point_v<T> || std::is_same_v<T, std::complex<double>>
21 || std::is_same_v<T, std::complex<float>>;
24template <scalar T, typename = void>
25struct scalar_value_type
26{
28 typedef T value_type;
29};
31template <scalar T>
32struct scalar_value_type<T, std::void_t<typename T::value_type>>
33{
34 typedef typename T::value_type value_type;
35};
37template <scalar T>
38using scalar_value_type_t = typename scalar_value_type<T>::value_type;
39} // namespace dolfinx
Definition types.h:20
Top-level namespace.
Definition defines.h:12