Skip to content

Commit ca9c11e

Browse files
committed
temporary as.hpp
1 parent 628ae8f commit ca9c11e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

inst/include/cpp11/as.hpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,9 +344,13 @@ inline SEXP as_sexp(const std::complex<double>& x) {
344344
return result;
345345
}
346346

347-
// Specialization for converting SEXP to std::complex<double>
347+
// Declaration for converting SEXP to std::complex<double>
348348
template <>
349-
inline std::complex<double> as_cpp(SEXP x) {
349+
std::complex<double> as_cpp(SEXP x);
350+
351+
// Specialization for as_cpp with std::complex<double>
352+
template <>
353+
inline std::complex<double> as_cpp<std::complex<double>>(SEXP x) {
350354
if (TYPEOF(x) != CPLXSXP || Rf_length(x) != 1) {
351355
throw std::invalid_argument("Expected a single complex number.");
352356
}

0 commit comments

Comments
 (0)