[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:
@@ -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>);
|
||||
Reference in New Issue
Block a user