-
-
Notifications
You must be signed in to change notification settings - Fork 219
Variadic templates refinement #1336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,23 @@ | ||
2024-10-07 Iñaki Ucar <[email protected]> | ||
|
||
* inst/include/Rcpp/platform/compiler.h: Uncomment HAS_VARIADIC_TEMPLATES | ||
macro definition | ||
* src/api.cpp: Simplify checks for variadic templates | ||
* inst/include/Rcpp/DataFrame.h: Idem | ||
* inst/include/Rcpp/DottedPair.h: Idem | ||
* inst/include/Rcpp/Function.h: Idem | ||
* inst/include/Rcpp/InternalFunctionWithStdFunction.h: Idem | ||
* inst/include/Rcpp/Language.h: Idem | ||
* inst/include/Rcpp/Pairlist.h: Idem | ||
* inst/include/Rcpp/grow.h: Idem | ||
* inst/include/Rcpp/internal/call.h: Idem | ||
* inst/include/Rcpp/module/class.h: Idem | ||
* inst/include/Rcpp/traits/index_sequence.h: Idem | ||
* inst/include/Rcpp/traits/named_object.h: Idem | ||
* inst/include/Rcpp/vector/Vector.h: Idem | ||
* inst/include/Rcpp/Module.h: Idem + add missing is_void method | ||
* inst/tinytest/test_module.R: Add test for void functions and methods | ||
|
||
2024-10-04 Dirk Eddelbuettel <[email protected]> | ||
|
||
* DESCRIPTION (Version, Date): Roll micro version to 1.0.13.3 | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,11 +22,25 @@ if( ! Rcpp:::capabilities()[["Rcpp modules"]] ) exit_file("Skipping as no Module | |
|
||
Rcpp::sourceCpp("cpp/Module.cpp") | ||
|
||
# checks the presence of "invisible", added when the function returns void | ||
is_void <- function(call) { | ||
if (length(grep("invisible", deparse(call))) == 0) | ||
return(FALSE) | ||
return(TRUE) | ||
} | ||
|
||
# test.Module <- function(){ | ||
expect_equal( bar( 2L ), 4L ) | ||
expect_equal( foo( 2L, 10.0 ), 20.0 ) | ||
expect_equal( hello(), "hello" ) | ||
|
||
expect_false(is_void([email protected])) | ||
expect_false(is_void([email protected])) | ||
expect_false(is_void([email protected])) | ||
expect_true(is_void([email protected])) | ||
expect_true(is_void([email protected])) | ||
expect_true(is_void([email protected])) | ||
|
||
w <- new( ModuleWorld ) | ||
expect_equal( w$greet(), "hello" ) | ||
w$set( "hello world" ) | ||
|
@@ -38,13 +52,24 @@ expect_equal( w$greet(), "hello world const ref" ) | |
w$clear( ) | ||
expect_equal( w$greet(), "" ) | ||
|
||
expect_false(is_void(w$greet)) | ||
expect_true(is_void(w$set)) | ||
expect_true(is_void(w$set_ref)) | ||
expect_true(is_void(w$set_const_ref)) | ||
expect_true(is_void(w$clear)) | ||
|
||
# test.Module.exposed.class <- function(){ | ||
test <- new( ModuleTest, 3.0 ) | ||
expect_equal( Test_get_x_const_ref(test), 3.0 ) | ||
expect_equal( Test_get_x_const_pointer(test), 3.0 ) | ||
expect_equal( Test_get_x_ref(test), 3.0 ) | ||
expect_equal( Test_get_x_pointer(test), 3.0 ) | ||
|
||
expect_false(is_void([email protected])) | ||
expect_false(is_void([email protected])) | ||
expect_false(is_void([email protected])) | ||
expect_false(is_void([email protected])) | ||
|
||
expect_equal( attr_Test_get_x_const_ref(test), 3.0 ) | ||
expect_equal( attr_Test_get_x_const_pointer(test), 3.0 ) | ||
expect_equal( attr_Test_get_x_ref(test), 3.0 ) | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great catch!