-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathDots.h
More file actions
41 lines (30 loc) · 950 Bytes
/
Dots.h
File metadata and controls
41 lines (30 loc) · 950 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#ifndef Rcpp_Dots_h
#define Rcpp_Dots_h
namespace Rcpp{
template < template <class> class StoragePolicy>
class Dots_Impl {
public:
typedef Environment_Impl<StoragePolicy> Environment ;
typedef Promise_Impl<StoragePolicy> Promise ;
Dots_Impl( Environment env){
SEXP dots = env.find("...") ;
while(dots != R_NilValue){
promises.push_back(CAR(dots)) ;
dots = CDR(dots);
}
}
inline int size() const {
return promises.size() ;
}
inline Promise& promise(int i) {
return promises[i] ;
}
inline Environment environment(int i){
return promises[i].environment() ;
}
private:
std::vector<Promise> promises ;
} ;
typedef Dots_Impl<NoProtectStorage> Dots ;
}
#endif