Skip to content

Commit 4209cc9

Browse files
committed
Scalar type
1 parent 3be550d commit 4209cc9

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

stan/math/prim/fun/serializer.hpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#ifndef STAN_MATH_PRIM_FUN_SERIALIZER_HPP
22
#define STAN_MATH_PRIM_FUN_SERIALIZER_HPP
33

4+
#include <stan/math/prim/meta/promote_scalar_type.hpp>
45
#include <stan/math/prim/fun/to_vector.hpp>
56
#include <stan/math/prim/fun/to_array_1d.hpp>
67
#include <complex>
@@ -95,8 +96,8 @@ struct deserializer {
9596
*/
9697
template <typename U, require_std_vector_t<U>* = nullptr,
9798
require_not_st_complex<U>* = nullptr>
98-
typename promote_scalar_type<T, U>::type read(const U& x) {
99-
typename promote_scalar_type<T, U>::type y;
99+
promote_scalar_t<T, U> read(const U& x) {
100+
promote_scalar_t<T, U> y;
100101
y.reserve(x.size());
101102
for (size_t i = 0; i < x.size(); ++i)
102103
y.push_back(read(x[i]));
@@ -114,8 +115,8 @@ struct deserializer {
114115
* @return deserialized value with shape and size matching argument
115116
*/
116117
template <typename U, require_std_vector_st<is_complex, U>* = nullptr>
117-
typename promote_scalar_type<std::complex<T>, U>::type read(const U& x) {
118-
typename promote_scalar_type<std::complex<T>, U>::type y;
118+
promote_scalar_t<std::complex<T>, U> read(const U& x) {
119+
promote_scalar_t<std::complex<T>, U> y;
119120
y.reserve(x.size());
120121
for (size_t i = 0; i < x.size(); ++i)
121122
y.push_back(read(x[i]));

0 commit comments

Comments
 (0)