Skip to content

Commit 795b189

Browse files
committed
revert Timer to using iterators over functions from an anon namespace
1 parent f5b22ea commit 795b189

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

ChangeLog

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22

33
* vignettes/Rcpp-FAQ.Rnw: Render code with background boxen
44
* vignettes/Rcpp-package.Rnw: Idem
5-
* vignettes/Rcpp-modules.Rnw: Idem
6-
* vignettes/Rcpp-extending.Rnw: Idem
7-
* vignettes/Rcpp-sugar.Rnw: Idem
5+
* vignettes/Rcpp-modules.Rnw: Idem
6+
* vignettes/Rcpp-extending.Rnw: Idem
7+
* vignettes/Rcpp-sugar.Rnw: Idem
8+
9+
* inst/include/Rcpp/Benchmark/Timer.h: Reverted back to using
10+
iterators via use of anonymous namespace for accessors
811

912
2014-01-31 JJ Allaire <[email protected]>
1013

inst/include/Rcpp/Benchmark/Timer.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,14 @@ namespace Rcpp{
100100

101101
#endif
102102

103+
namespace{
104+
std::string get_first(const std::pair<std::string,nanotime_t>& pair) {
105+
return pair.first;
106+
}
107+
double get_second(const std::pair<std::string,nanotime_t>& pair){
108+
return static_cast<double>(pair.second);
109+
}
110+
}
103111

104112
class Timer {
105113
public:

0 commit comments

Comments
 (0)