approvals / ApprovalTests.cpp

Native ApprovalTests for C++ on Linux, Mac and Windows
https://approvaltestscpp.readthedocs.io/en/latest/
Apache License 2.0
318 stars 51 forks source link

Unify Reporter enable_ifs #48

Closed claremacrae closed 4 years ago

claremacrae commented 5 years ago

This captures what I learned from this really helpful comment by @mika-fischer

https://github.com/approvals/ApprovalTests.cpp/issues/33#issuecomment-542548813

I make the assumption that no-one is likely to have used the previous IsNotDerivedFromReporter in Reporter.h... To guard against it being used in future, I've followed the practice these days of putting it in to a Detail namespace.

Thanks to the godbolt link in Mika's earlier comment, I was able to confirm with non-compiling code that the std::decay really was needed - and I added a test case that shows two cases that do compile correctly, and some commented out code that doesn't compile, if activated, to at least show my working...