@@ -29,24 +29,29 @@ requires(concepts::field_backend<T> &&
29
29
30
30
if constexpr (can_construct_with_stream) {
31
31
return typename T::owning_data_t (std::forward<U>(backend), stream);
32
- } else if constexpr (std::constructible_from<
33
- typename T::owning_data_t ,
34
- decltype (backend.get_configuration ()),
35
- typename T::backend_t ::owning_data_t &&>)
36
- {
37
- return typename T::owning_data_t (
38
- backend.get_configuration (),
39
- copy_backend_with_stream<typename T::backend_t >(
40
- backend.get_backend (), stream
41
- )
42
- );
43
32
} else {
44
- return typename T::owning_data_t (make_parameter_pack (
45
- backend.get_configuration (),
46
- copy_backend_with_stream<typename T::backend_t >(
47
- backend.get_backend (), stream
48
- )
49
- ));
33
+ auto new_backend = copy_backend_with_stream<typename T::backend_t >(
34
+ backend.get_backend (), stream
35
+ );
36
+
37
+ if constexpr (std::constructible_from<
38
+ typename T::owning_data_t ,
39
+ typename T::backend_t ::owning_data_t &&>)
40
+ {
41
+ return typename T::owning_data_t (std::move (new_backend));
42
+ } else if constexpr (std::constructible_from<
43
+ typename T::owning_data_t ,
44
+ decltype (backend.get_configuration ()),
45
+ typename T::backend_t ::owning_data_t &&>)
46
+ {
47
+ return typename T::owning_data_t (
48
+ backend.get_configuration (), std::move (new_backend)
49
+ );
50
+ } else {
51
+ return typename T::owning_data_t (make_parameter_pack (
52
+ backend.get_configuration (), std::move (new_backend)
53
+ ));
54
+ }
50
55
}
51
56
}
52
57
0 commit comments