Skip to content

Commit 9642541

Browse files
committed
Enable export of C++ interface for functions that return void
1 parent d5504a2 commit 9642541

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2015-10-01 JJ Allaire <[email protected]>
2+
3+
* src/attributes.cpp: Enable export of C++ interface for
4+
functions that return void
5+
16
2015-09-28 Dirk Eddelbuettel <[email protected]>
27

38
* inst/NEWS.Rd: GitHub pull requests and issues are now linked

inst/NEWS.Rd

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
\item No longer use \code{STRING_ELT} as left-hand side, thanks to a
1313
heads-up by Luke Tierney (PR \ghpr{378} fixing \ghit{377}).
1414
}
15+
\item Changes in Rcpp Attributes:
16+
\itemize{
17+
\item Enable export of C++ interface for functions that return void.
18+
}
1519
\item Changes in Rcpp Documentation:
1620
\itemize{
1721
\item The \code{NEWS} file now links to GitHub issue tickets and pull

src/attributes.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2035,9 +2035,11 @@ namespace attributes {
20352035
<< " throw Rcpp::exception(as<std::string>("
20362036
<< "__result).c_str());"
20372037
<< std::endl;
2038-
ostr() << " return Rcpp::as<" << function.type() << " >"
2039-
<< "(__result);" << std::endl;
2040-
2038+
if (!function.type().isVoid()) {
2039+
ostr() << " return Rcpp::as<" << function.type() << " >"
2040+
<< "(__result);" << std::endl;
2041+
}
2042+
20412043
ostr() << " }" << std::endl << std::endl;
20422044
}
20432045
}

0 commit comments

Comments
 (0)