We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 628ae8f commit ca9c11eCopy full SHA for ca9c11e
inst/include/cpp11/as.hpp
@@ -344,9 +344,13 @@ inline SEXP as_sexp(const std::complex<double>& x) {
344
return result;
345
}
346
347
-// Specialization for converting SEXP to std::complex<double>
+// Declaration for converting SEXP to std::complex<double>
348
template <>
349
-inline std::complex<double> as_cpp(SEXP x) {
+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) {
354
if (TYPEOF(x) != CPLXSXP || Rf_length(x) != 1) {
355
throw std::invalid_argument("Expected a single complex number.");
356
0 commit comments