This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[libstdc++ PATCH] C++14 constexpr min/max/minmax/min_element/max_element/minmax_element, also constexpr for 20.9.5-20.9.9, aka various library functors


Currently finishing testing on Linux-x64. The only implementation change
in this patch is the initialization of the iterator variables in
__minmax_element,
otherwise it's just adding constexpr.

2014-12-18  Ville Voutilainen  <ville.voutilainen@gmail.com>
    C++14 constexpr min, max, minmax, min_element, max_element
    and minmax_element. Also constexpr for 20.9.5-20.9.9,
    aka various library functors.
    * include/bits/c++config: Add _GLIBCXX14_CONSTEXPR.
    * include/bits/algorithmfwd.h: Use it for min, max, minmax,
    min_element and max_element.
    * include/bits/predefined_ops.h: Use it for _Iter_less_iter and
    _Iter_comp_iter.
    * include/bits/stl_algo.h: Use it for minmax, __minmax_element,
    min, max, __min_element and max_element.
    Also initialize the iterator variables in __minmax_element.
    * include/bits/stl_algobase.h: Use it for min and max.
    * include/bits/stl_function.h: Use it for plus, minus,
    multiplies, divides, modulus, negate, equal_to, not_equal_to,
    greater, less, greater_equal, less_equal, logical_and, logical_or,
    logical_not, bit_and, bit_or, bit_xor, bit_not, unary_negate,
    not1, binary_negate and not2.
    * testsuite/20_util/function_objects/constexpr.cc: New.
    * testsuite/25_algorithms/max/constexpr.cc: Likewise.
    * testsuite/25_algorithms/max_element/constexpr.cc: Likewise.
    * testsuite/25_algorithms/min/constexpr.cc: Likewise.
    * testsuite/25_algorithms/min_element/constexpr.cc: Likewise.
    * testsuite/25_algorithms/minmax/constexpr.cc: Likewise.
    * testsuite/25_algorithms/minmax_element/constexpr.cc: Likewise.

Attachment: constexpr-minmax.diff
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]