Skip to content

Supply old RangePair and ArgPair API for C++03 compatibility.#278

Merged
dmah42 merged 8 commits intogoogle:masterfrom
efcs:ranges-revert
Aug 29, 2016
Merged

Supply old RangePair and ArgPair API for C++03 compatibility.#278
dmah42 merged 8 commits intogoogle:masterfrom
efcs:ranges-revert

Conversation

@EricWF
Copy link
Contributor

@EricWF EricWF commented Aug 28, 2016

The new Ranges and Args interface requires C++11 initializer lists to be useful. In C++03 the new interface is almost impossible to use. This patch re-adds the old C++03 interface for continued compatibility.

Additionally this patch re-adds the range_x() and range_y() methods but marks them as deprecated. This should allow older benchmarks to continue to compile while making it clear that this interface is deprecated.

The final change in this patch gives ranges(pos) the default argument 0 allowing ranges() to work. This seems like a convenience to me but I"m happy to remove it.

@AppVeyorBot
Copy link

Build benchmark 383 failed (commit c562760de4 by @EricWF)

@coveralls
Copy link

Coverage Status

Coverage increased (+0.1%) to 87.725% when pulling 01d768b on efcs:ranges-revert into 0ed4456 on google:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.1%) to 87.763% when pulling b28b33f on efcs:ranges-revert into db1af86 on google:master.

@AppVeyorBot
Copy link

Build benchmark 390 failed (commit dd76817db3 by @EricWF)

@coveralls
Copy link

Coverage Status

Coverage increased (+0.08%) to 87.77% when pulling 2378b5a on efcs:ranges-revert into 2e0796e on google:master.

@AppVeyorBot
Copy link

Build benchmark 394 failed (commit 47edc4be5c by @EricWF)

// Equivalent to Args({x, y})
// NOTE: This is a legacy C++03 interface provided for compatibility only.
// New code should use 'Args'.
Benchmark* ArgPair(int x, int y) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we also mark these as deprecated?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so. Using the replacements requires C++11. So if you want C++03 benchmarks you still need this interface.

@dmah42
Copy link
Member

dmah42 commented Aug 29, 2016

LGTM

@dmah42 dmah42 merged commit 49bbff2 into google:master Aug 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants