[libcxx][iterator] adds std::indirectly_readable and std::indirectly_writable

Implements parts of:
    * P0896R4 The One Ranges Proposal`

Depends on D99873.

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D100073
This commit is contained in:
Christopher Di Bella
2021-04-21 16:41:13 +00:00
parent 89b59345ee
commit 04733181b5
41 changed files with 1151 additions and 13 deletions

View File

@@ -0,0 +1,27 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14, c++17
// UNSUPPORTED: libcpp-no-concepts
// UNSUPPORTED: gcc-10
// iterator, const_iterator, reverse_iterator, const_reverse_iterator
#include <string>
#include <iterator>
using iterator = std::string::iterator;
using const_iterator = std::string::const_iterator;
using value_type = iterator::value_type;
static_assert(std::indirectly_readable<iterator>);
static_assert(std::indirectly_writable<iterator, value_type>);
static_assert(std::indirectly_readable<const_iterator>);
static_assert(!std::indirectly_writable<const_iterator, value_type>);