DUNE-ACFEM (unstable)

assign.hh
1#ifndef __DUNE_ACFEM_MPL_ASSIGN_HH__
2#define __DUNE_ACFEM_MPL_ASSIGN_HH__
3
4#include <tuple>
5#include <array>
6
7#include "access.hh"
8#include "foreach.hh"
9
10namespace Dune {
11
12 namespace ACFem {
13
35 template<class T1, class T2,
36 std::enable_if_t<(IsTupleLike<T1>::value
37 && IsTupleLike<T2>::value
38 && size<T1>() == size<T2>())
39 , int> = 0>
40 auto& assign(T1& t1, T2&& t2)
41 {
42 forLoop<size<T1>()>([&] (auto i) {
43 std::get<i>(t1) = std::get<i>(t2);
44 });
45 return t1;
46 }
47
49
51
53
54 } // ACFem::
55
56} // Dune::
57
58#endif // __DUNE_ACFEM_MPL_ASSIGN_HH__
auto & assign(T1 &t1, T2 &&t2)
Assign one tuple-alike to another by looping over the elements.
Definition: assign.hh:40
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden & Uni Heidelberg  |  generated with Hugo v0.111.3 (Jun 19, 23:17, 2026)