@@ -25,29 +25,29 @@ std::string hello() {
25
25
throw std::range_error ( " boom" ) ;
26
26
}
27
27
28
- int bar ( int x){
29
- return x*2 ;
28
+ int bar (int x) {
29
+ return x*2 ;
30
30
}
31
31
32
- double foo ( int x, double y){
33
- return x * y ;
32
+ double foo (int x, double y) {
33
+ return x * y;
34
34
}
35
35
36
- void bla ( ) {
37
- Rprintf ( " hello\\ n" ) ;
36
+ void bla () {
37
+ Rprintf (" hello\\ n" ) ;
38
38
}
39
39
40
- void bla1 ( int x){
41
- Rprintf ( " hello (x = %d)\\ n" , x ) ;
40
+ void bla1 (int x) {
41
+ Rprintf (" hello (x = %d)\\ n" , x) ;
42
42
}
43
43
44
- void bla2 ( int x, double y){
45
- Rprintf ( " hello (x = %d, y = %5.2f)\\ n" , x, y ) ;
44
+ void bla2 ( int x, double y) {
45
+ Rprintf (" hello (x = %d, y = %5.2f)\\ n" , x, y) ;
46
46
}
47
47
48
48
class World {
49
49
public:
50
- World () : msg(" hello" ){}
50
+ World () : msg(" hello" ) {}
51
51
void set (std::string msg) { this ->msg = msg; }
52
52
std::string greet () { return msg; }
53
53
@@ -60,25 +60,25 @@ class World {
60
60
RCPP_MODULE (yada){
61
61
using namespace Rcpp ;
62
62
63
- function ( " hello" , &hello , " documentation for hello " );
64
- function ( " bla" , &bla , " documentation for bla " );
65
- function ( " bla1" , &bla1 , " documentation for bla1 " );
66
- function ( " bla2" , &bla2 , " documentation for bla2 " );
63
+ function (" hello" , &hello , " documentation for hello " );
64
+ function (" bla" , &bla , " documentation for bla " );
65
+ function (" bla1" , &bla1 , " documentation for bla1 " );
66
+ function (" bla2" , &bla2 , " documentation for bla2 " );
67
67
68
68
// with formal arguments specification
69
- function ( " bar" , &bar ,
70
- List::create ( _[" x" ] = 0.0 ),
71
- " documentation for bar " ) ;
72
- function ( " foo" , &foo ,
73
- List::create ( _[" x" ] = 1 , _[" y" ] = 1.0 ),
74
- " documentation for foo " ) ;
69
+ function (" bar" , &bar ,
70
+ List::create ( _[" x" ] = 0.0 ),
71
+ " documentation for bar " ) ;
72
+ function (" foo" , &foo ,
73
+ List::create ( _[" x" ] = 1 , _[" y" ] = 1.0 ),
74
+ " documentation for foo " ) ;
75
75
76
- class_<World>( " World" )
76
+ class_<World>(" World" )
77
77
// expose the default constructor
78
78
.constructor ()
79
79
80
- .method ( " greet" , &World::greet , " get the message" )
81
- .method ( " set" , &World::set , " set the message" )
80
+ .method (" greet" , &World::greet , " get the message" )
81
+ .method (" set" , &World::set , " set the message" )
82
82
;
83
83
}
84
84
0 commit comments