[libcxx] r225375 - In C++03, a bunch of the arithmetic/logical/comparison functors (such as add/equal_to/logical_or) were defined as deriving from binary_funtion. That restriction was removed in C++11, but the tests still check for this. Change the test to look for the embedded types first_argument/second_argument/result_type. No change to the library, just more standards-compliant tests. Thanks to STL @ Microsoft for the suggestion.
Marshall Clow
mclow.lists at gmail.com
Fri Jan 9 11:35:03 PST 2015
> On Jan 9, 2015, at 9:06 AM, David Blaikie <dblaikie at gmail.com> wrote:
>
>
>
> On Wed, Jan 7, 2015 at 12:31 PM, Marshall Clow <mclow.lists at gmail.com <mailto:mclow.lists at gmail.com>> wrote:
> Author: marshall
> Date: Wed Jan 7 14:31:06 2015
> New Revision: 225375
>
> URL: http://llvm.org/viewvc/llvm-project?rev=225375&view=rev <http://llvm.org/viewvc/llvm-project?rev=225375&view=rev>
> Log:
> In C++03, a bunch of the arithmetic/logical/comparison functors (such as add/equal_to/logical_or) were defined as deriving from binary_funtion. That restriction was removed in C++11, but the tests still check for this. Change the test to look for the embedded types first_argument/second_argument/result_type. No change to the library, just more standards-compliant tests. Thanks to STL @ Microsoft for the suggestion.
>
> Are there any tests around to ensure the C++03 behavior remains in C++03? Or is that not worth worrying about/preserving/implementing?
The tests will continue to pass if the functors are derived from binary_function (which is how libc++ implements them).
Other than that, no.
binary_function is an empty struct with three nested typedefs:
template <class Arg1, class Arg2, class Result>
struct binary_function
{
typedef Arg1 first_argument_type;
typedef Arg2 second_argument_type;
typedef Result result_type;
};
The tests (now) check for the existence (and correctness) of first_argument_type, second_argument_type and result_type.
— Marshall
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150109/b41406bc/attachment.html>
More information about the cfe-commits
mailing list