@@ -425,11 +425,17 @@ class State {
425425
426426 // Range arguments for this run. CHECKs if the argument has been set.
427427 BENCHMARK_ALWAYS_INLINE
428- int range (std::size_t pos) const {
428+ int range (std::size_t pos = 0 ) const {
429429 assert (range_.size () > pos);
430430 return range_[pos];
431431 }
432432
433+ BENCHMARK_DEPRECATED_MSG (" use 'range(0)' instead" )
434+ int range_x () const { return range (0 ); }
435+
436+ BENCHMARK_DEPRECATED_MSG (" use 'range(1)' instead" )
437+ int range_y () const { return range (1 ); }
438+
433439 BENCHMARK_ALWAYS_INLINE
434440 size_t iterations () const { return total_iterations_; }
435441
@@ -498,11 +504,31 @@ class Benchmark {
498504 // REQUIRES: The function passed to the constructor must accept arg1, arg2 ...
499505 Benchmark* Args (const std::vector<int >& args);
500506
507+ // Equivalent to Args({x, y})
508+ // NOTE: This is a legacy C++03 interface provided for compatibility only.
509+ // New code should use 'Args'.
510+ Benchmark* ArgPair (int x, int y) {
511+ std::vector<int > args;
512+ args.push_back (x);
513+ args.push_back (y);
514+ return Args (args);
515+ }
516+
501517 // Run this benchmark once for a number of values picked from the
502518 // ranges [start..limit]. (starts and limits are always picked.)
503519 // REQUIRES: The function passed to the constructor must accept arg1, arg2 ...
504520 Benchmark* Ranges (const std::vector<std::pair<int , int > >& ranges);
505521
522+ // Equivalent to Ranges({{lo1, hi1}, {lo2, hi2}}).
523+ // NOTE: This is a legacy C++03 interface provided for compatibility only.
524+ // New code should use 'Ranges'.
525+ Benchmark* RangePair (int lo1, int hi1, int lo2, int hi2) {
526+ std::vector<std::pair<int , int > > ranges;
527+ ranges.push_back (std::make_pair (lo1, hi1));
528+ ranges.push_back (std::make_pair (lo2, hi2));
529+ return Ranges (ranges);
530+ }
531+
506532 // Pass this benchmark object to *func, which can customize
507533 // the benchmark by calling various methods like Arg, Args,
508534 // Threads, etc.
0 commit comments