Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
// <algorithm>

// template<class ForwardIterator1, class ForwardIterator2, class BinaryPredicate>
// bool
// constexpr bool // constexpr after C++17
// is_permutation(ForwardIterator1 first1, ForwardIterator1 last1,
// ForwardIterator2 first2, BinaryPredicate pred);

Expand All @@ -28,6 +28,21 @@ bool counting_equals ( const T &a, const T &b ) {
return a == b;
}

#if TEST_STD_VER > 17
TEST_CONSTEXPR int test_constexpr() {
int ia[] = {0, 0, 0};
int ib[] = {1, 1, 0};
int ic[] = {1, 0, 1};
int id[] = {1};
std::equal_to<int> c;
return !std::is_permutation(std::begin(ia), std::end(ia), std::begin(ib) , c)
&& !std::is_permutation(std::begin(ia), std::end(ia), std::begin(ib), std::end(ib), c)
&& std::is_permutation(std::begin(ib), std::end(ib), std::begin(ic) , c)
&& std::is_permutation(std::begin(ib), std::end(ib), std::begin(ic), std::end(ic), c)
&& !std::is_permutation(std::begin(ic), std::end(ic), std::begin(id), std::end(id), c)
;
}
#endif

int main()
{
Expand Down Expand Up @@ -723,4 +738,8 @@ int main()
std::equal_to<const int>()) == false);
#endif
}

#if TEST_STD_VER > 17
static_assert(test_constexpr());
#endif
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,23 @@

// template<RandomAccessIterator Iter>
// requires LessThanComparable<Iter::value_type>
// bool
// constexpr bool // constexpr after C++17
// is_heap(Iter first, Iter last);

#include <algorithm>
#include <cassert>

#include "test_macros.h"

#if TEST_STD_VER > 17
TEST_CONSTEXPR int test_constexpr() {
int ia[] = {1, 1, 1, 1, 0, 1, 1};
int ib[] = {0, 0, 1, 0, 0, 0, 0};
return std::is_heap(std::begin(ia), std::end(ia))
&& !std::is_heap(std::begin(ib), std::end(ib));
}
#endif

void test()
{
int i1[] = {0, 0};
Expand Down Expand Up @@ -518,4 +529,8 @@ void test()
int main()
{
test();

#if TEST_STD_VER > 17
static_assert(test_constexpr());
#endif
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,24 @@

// template<RandomAccessIterator Iter>
// requires LessThanComparable<Iter::value_type>
// bool
// constexpr bool // constexpr after C++17
// is_heap(Iter first, Iter last);

#include <algorithm>
#include <functional>
#include <cassert>

#include "test_macros.h"

#if TEST_STD_VER > 17
TEST_CONSTEXPR int test_constexpr() {
int ia[] = {0, 0, 1, 1, 1};
int ib[] = {1, 0, 4, 1, 0};
return std::is_heap(std::begin(ia), std::end(ia), std::greater<int>())
&& !std::is_heap(std::begin(ib), std::end(ib), std::greater<int>());
}
#endif

void test()
{
int i1[] = {0, 0};
Expand Down Expand Up @@ -519,4 +530,8 @@ void test()
int main()
{
test();

#if TEST_STD_VER > 17
static_assert(test_constexpr());
#endif
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,23 @@

// template<RandomAccessIterator Iter>
// requires LessThanComparable<Iter::value_type>
// Iter
// constexpr bool // constexpr after C++17
// is_heap_until(Iter first, Iter last);

#include <algorithm>
#include <cassert>

#include "test_macros.h"

#if TEST_STD_VER > 17
TEST_CONSTEXPR int test_constexpr() {
int ia[] = {0, 0, 0, 0, 1, 0};
int ib[] = {0, 0, 0, 1, 1, 1};
return (std::is_heap_until(std::begin(ia), std::end(ia)) == ia+4)
&& (std::is_heap_until(std::begin(ib), std::end(ib)) == ib+3);
}
#endif

void test()
{
int i1[] = {0, 0};
Expand Down Expand Up @@ -518,4 +529,8 @@ void test()
int main()
{
test();

#if TEST_STD_VER > 17
static_assert(test_constexpr());
#endif
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,24 @@

// template<RandomAccessIterator Iter, StrictWeakOrder<auto, Iter::value_type> Compare>
// requires CopyConstructible<Compare>
// Iter
// constexpr bool // constexpr after C++17
// is_heap_until(Iter first, Iter last, Compare comp);

#include <algorithm>
#include <functional>
#include <cassert>

#include "test_macros.h"

#if TEST_STD_VER > 17
TEST_CONSTEXPR int test_constexpr() {
int ia[] = {1, 0, 0, 0};
int ib[] = {0, 1, 1, 0};
return (std::is_heap_until(std::begin(ia), std::end(ia), std::greater<int>()) == ia+1)
&& (std::is_heap_until(std::begin(ib), std::end(ib), std::greater<int>()) == ib+3);
}
#endif

void test()
{
int i1[] = {0, 0};
Expand Down Expand Up @@ -519,4 +530,8 @@ void test()
int main()
{
test();

#if TEST_STD_VER > 17
static_assert(test_constexpr());
#endif
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@

#include "test_iterators.h"

#if TEST_STD_VER > 17
TEST_CONSTEXPR int test_constexpr() {
int ia[] = {0, 0, 1, 1};
int ib[] = {1, 1, 0, 0};
return std::is_sorted(std::begin(ia), std::end(ia))
&& !std::is_sorted(std::begin(ib), std::end(ib));
}
#endif

template <class Iter>
void
test()
Expand Down Expand Up @@ -180,4 +189,8 @@ int main()
test<bidirectional_iterator<const int*> >();
test<random_access_iterator<const int*> >();
test<const int*>();

#if TEST_STD_VER > 17
static_assert(test_constexpr());
#endif
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@

#include "test_iterators.h"

#if TEST_STD_VER > 17
TEST_CONSTEXPR int test_constexpr() {
int ia[] = {1, 1, 0, 0};
int ib[] = {0, 0, 1, 1};
return std::is_sorted(std::begin(ia), std::end(ia), std::greater<int>())
&& !std::is_sorted(std::begin(ib), std::end(ib), std::greater<int>());
}
#endif

template <class Iter>
void
test()
Expand Down Expand Up @@ -181,4 +190,8 @@ int main()
test<bidirectional_iterator<const int*> >();
test<random_access_iterator<const int*> >();
test<const int*>();

#if TEST_STD_VER > 17
static_assert(test_constexpr());
#endif
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@

#include "test_iterators.h"

#if TEST_STD_VER > 17
TEST_CONSTEXPR int test_constexpr() {
int ia[] = {0, 1, 0};
int ib[] = {0, 1, 1};
return (std::is_sorted_until(std::begin(ia), std::end(ia)) == ia+2)
&& (std::is_sorted_until(std::begin(ib), std::end(ib)) == ib+3);
}
#endif

template <class Iter>
void
test()
Expand Down Expand Up @@ -180,4 +189,8 @@ int main()
test<bidirectional_iterator<const int*> >();
test<random_access_iterator<const int*> >();
test<const int*>();

#if TEST_STD_VER > 17
static_assert(test_constexpr());
#endif
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@

#include "test_iterators.h"

#if TEST_STD_VER > 17
TEST_CONSTEXPR int test_constexpr() {
int ia[] = {1, 0, 1};
int ib[] = {1, 1, 0};
return (std::is_sorted_until(std::begin(ia), std::end(ia), std::greater<int>()) == ia+2)
&& (std::is_sorted_until(std::begin(ib), std::end(ib), std::greater<int>()) == ib+3);
}
#endif

template <class Iter>
void
test()
Expand Down Expand Up @@ -181,4 +190,8 @@ int main()
test<bidirectional_iterator<const int*> >();
test<random_access_iterator<const int*> >();
test<const int*>();

#if TEST_STD_VER > 17
static_assert(test_constexpr());
#endif
}
6 changes: 3 additions & 3 deletions libcxx/www/cxx2a_status.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ <h3>Paper Status</h3>
<tr><td></td><td></td><td></td><td></td><td></td><td></td></tr>
<tr><td><a href="https://wg21.link/P0020R6">P0020R6</a></td><td>LWG</td><td>Floating Point Atomic</td><td>Albuquerque</td><td></td><td></td></tr>
<tr><td><a href="https://wg21.link/P0053R7">P0053R7</a></td><td>LWG</td><td>C++ Synchronized Buffered Ostream</td><td>Albuquerque</td><td></td><td></td></tr>
<tr><td><a href="https://wg21.link/P0202R3">P0202R3</a></td><td>LWG</td><td>Add constexpr modifiers to functions in &lt;algorithm&gt; and &lt;utility&gt; Headers</td><td>Albuquerque</td><td></td><td></td></tr>
<tr><td><a href="https://wg21.link/P0202R3">P0202R3</a></td><td>LWG</td><td>Add constexpr modifiers to functions in &lt;algorithm&gt; and &lt;utility&gt; Headers</td><td>Albuquerque</td><td><I>In Progress</I></td><td>7.0</td></tr>
<tr><td><a href="https://wg21.link/P0415R1">P0415R1</a></td><td>LWG</td><td>Constexpr for <tt>std::complex</tt></td><td>Albuquerque</td><td></td><td></td></tr>
<tr><td><a href="https://wg21.link/P0439R0">P0439R0</a></td><td>LWG</td><td>Make <tt>std::memory_order</tt> a scoped enumeration</td><td>Albuquerque</td><td></td><td></td></tr>
<tr><td><a href="https://wg21.link/P0457R2">P0457R2</a></td><td>LWG</td><td>String Prefix and Suffix Checking</td><td>Albuquerque</td><td>Complete</td><td>6.0</td></tr>
<tr><td><a href="https://wg21.link/P0550R2">P0550R2</a></td><td>LWG</td><td>Transformation Trait <tt>remove_cvref</tt></td><td>Albuquerque</td><td>Complete</td><td>6.0</td></tr>
<tr><td><a href="https://wg21.link/P0600R1">P0600R1</a></td><td>LWG</td><td>nodiscard in the Library</td><td>Albuquerque</td><td><I>In Progress</I></td><td></td></tr>
<tr><td><a href="https://wg21.link/P0600R1">P0600R1</a></td><td>LWG</td><td>nodiscard in the Library</td><td>Albuquerque</td><td><I>In Progress</I></td><td>7.0</td></tr>
<tr><td><a href="https://wg21.link/P0616R0">P0616R0</a></td><td>LWG</td><td>de-pessimize legacy <numeric> algorithms with std::move</td><td>Albuquerque</td><td></td><td></td></tr>
<tr><td><a href="https://wg21.link/P0653R2">P0653R2</a></td><td>LWG</td><td>Utility to convert a pointer to a raw pointer</td><td>Albuquerque</td><td>Complete</td><td>6.0</td></tr>
<tr><td><a href="https://wg21.link/P0718R2">P0718R2</a></td><td>LWG</td><td>Atomic shared_ptr</td><td>Albuquerque</td><td></td><td></td></tr>
Expand Down Expand Up @@ -132,7 +132,7 @@ <h3>Library Working group Issues Status</h3>
<!-- <tr><td></td><td></td><td></td><td></td></tr> -->
</table>

<p>Last Updated: 16-Jul-2017</p>
<p>Last Updated: 15-Jan-2018</p>
</div>
</body>
</html>