Commit Graph

35 Commits

Author SHA1 Message Date
Arthur O'Dwyer 58915667d0 [libc++][modularisation] Split up <concepts> into granular headers.
This is the complete split of <concepts>, with nothing left in the main header.

Differential Revision: https://reviews.llvm.org/D107584
2021-08-10 22:02:41 -04:00
Arthur O'Dwyer ac42f76090 [libc++] s/_VSTD::_IsSame/_IsSame/. NFCI. 2021-08-05 23:29:53 -04:00
Christopher Di Bella 050b064f15 [libcxx][functional][modular] splices <functional> into modular headers
Differential Revision: https://reviews.llvm.org/D104942
2021-07-01 14:01:49 -04:00
zoecarver 89599e8b20 [libcxx][ranges] Add concepts in range.utility.helpers.
There are no changes to public APIs.

Differential Revision: https://reviews.llvm.org/D103493
2021-06-04 09:56:31 -07:00
Arthur O'Dwyer ab3fcc5065 [libc++] s/_VSTD::declval/declval/g. NFCI. 2021-05-11 12:23:55 -04:00
Mark de Wever cfef7c918b [libc++][NFC] Remove _VSTD:: when not needed.
Reviewed By: #libc, Quuxplusone

Differential Revision: https://reviews.llvm.org/D102133
2021-05-10 18:15:50 +02:00
Louis Dionne 97e383aa06 [libc++] Add std::ranges::iter_move and std::iter_rvalue_reference_t
Original patch by @cjdb, modified by @ldionne.

Differential Revision: https://reviews.llvm.org/D99873
2021-04-21 11:32:00 -04:00
zoecarver e0adf7e06a [libc++][NFC] Move incrementable_traits and indirectly_readable_traits into separate headers.
Differential Revision: https://reviews.llvm.org/D100682
2021-04-19 14:31:30 -04:00
Christopher Di Bella 920c0f7e09 [libcxx] adds __cpp_lib_concepts feature-test macro
Also adjusts C++20 status paper to indicate full concepts support.

Depends on D96477, D99817.

Differential Revision: https://reviews.llvm.org/D99805
2021-04-07 16:14:45 +00:00
Christopher Di Bella cedd07df51 [libcxx] fixes `common_reference` requirement for `swappable_with`
LWG3175 identifies that the `common_reference` requirement for
`swappable_with` is over-constraining and doesn't need to concern itself
with cv- or reference qualifiers.

Differential Revision: https://reviews.llvm.org/D99817
2021-04-07 05:51:36 +00:00
Christopher Di Bella 96dbdd753a [libcxx] adds remaining callable concepts
* `std::predicate`
* `std::relation`
* `std::equivalence_relation`
* `std::strict_weak_order`

Implements parts of:
    - P0898R3 Standard Library Concepts
    - P1754 Rename concepts to standard_case for C++20, while we still can

Differential Revision: https://reviews.llvm.org/D96477
2021-04-06 16:35:57 +00:00
Christopher Di Bella c25c22d5f9 [libcxx] moves `std::invoke` into `__functional_base`
Including `<concepts>` in other standard library headers (such as
`<iterator>`) creates circular dependencies due to `<functional>`.
Since `<concepts>` only needs `std::invoke` from `<functional>`, the
easiest, fastest, and cleanest way to eliminate the circular dep is to
move `std::invoke` into `__functional_base`.

This has the added advantage of `<concepts>` not transitively importing
`<functional>`.

Differential Revision: https://reviews.llvm.org/D99041
2021-04-06 01:25:15 +00:00
Christopher Di Bella 7959d59028 [libcxx] adds concepts `std::totally_ordered` and `std::totally_ordered_with`
Implements parts of:
    - P0898R3 Standard Library Concepts
    - P1754 Rename concepts to standard_case for C++20, while we still can

Reviewed By: Mordante

Differential Revision: https://reviews.llvm.org/D98983
2021-04-02 06:00:21 +00:00
Christopher Di Bella 8d4af1b6e0 [libcxx] adds concept std::regular
Implements parts of:
    - P0898R3 Standard Library Concepts
    - P1754 Rename concepts to standard_case for C++20, while we still can

Depends on D97911

Reviewed By: EricWF, #libc, Quuxplusone

Differential Revision: https://reviews.llvm.org/D98154
2021-03-12 08:54:03 -08:00
Christopher Di Bella 154395536e [libcxx] adds concept std::semiregular
Implements parts of:
    - P0898R3 Standard Library Concepts
    - P1754 Rename concepts to standard_case for C++20, while we still can

Depends on D97443

Reviewed By: Quuxplusone, EricWF, #libc

Differential Revision: https://reviews.llvm.org/D97911
2021-03-11 22:40:07 -08:00
Christopher Di Bella 8ef69c66d5 [libcxx] adds concept std::copyable
Implements parts of:
    - P0898R3 Standard Library Concepts
    - P1754 Rename concepts to standard_case for C++20, while we still can

Depends on D97359

Reviewed By: EricWF, #libc, Quuxplusone, zoecarver

Differential Revision: https://reviews.llvm.org/D97443
2021-03-11 19:30:55 -08:00
Christopher Di Bella dc9f385722 [libcxx] adds concept std::movable
Implements parts of:
    - P0898R3 Standard Library Concepts
    - P1754 Rename concepts to standard_case for C++20, while we still can

Depends on D97162

Reviewed By: EricWF, #libc, Quuxplusone

Differential Revision: https://reviews.llvm.org/D97359
2021-03-11 19:27:43 -08:00
Christopher Di Bella c744332793 [libcxx] adds std::ranges::swap, std::swappable, and std::swappable_with
Implements parts of:
    - P0898R3 Standard Library Concepts
    - P1754 Rename concepts to standard_case for C++20, while we still can

Depends on D96742

Differential Revision: https://reviews.llvm.org/D97162
2021-03-05 19:03:57 -08:00
Christopher Di Bella 6eb5d55c55 [libcxx] fixes up some [concepts]-related code
* moves `std::copy_constructible` so it comes before
  `std::equality_comparable_with`
* replaces a few uses of `auto`
2021-03-04 22:09:43 -08:00
Christopher Di Bella e63ddcccf8 [libcxx] adds concepts std::equality_comparable[_with]
Implements parts of:
    - P0898R3 Standard Library Concepts
    - P1754 Rename concepts to standard_case for C++20, while we still can

Depends on D96660

Reviewed By: ldionne, #libc, Quuxplusone

Differential Revision: https://reviews.llvm.org/D97176
2021-03-04 18:24:04 -08:00
Christopher Di Bella 647af31e74 [libcxx] adds concept `std::assignable_from`
Implements parts of:
    - P0898R3 Standard Library Concepts
    - P1754 Rename concepts to standard_case for C++20, while we still can

Depends on D96660

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D96742
2021-03-03 22:41:55 -08:00
Christopher Di Bella f893312c1a [libcxx] adds concept `std::common_with`
Implements parts of:
    - P0898R3 Standard Library Concepts
    - P1754 Rename concepts to standard_case for C++20, while we still can

Depends on D96660

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D96683
2021-03-03 20:01:11 -08:00
Christopher Di Bella 3f5438c46c [libcxx] adds concept `std::common_reference_with`
Implements parts of:
    - P0898R3 Standard Library Concepts
    - P1754 Rename concepts to standard_case for C++20, while we still can

Depends on D96657

Reviewed By: ldionne, Mordante, #libc

Differential Revision: https://reviews.llvm.org/D96660
2021-03-03 17:52:41 -08:00
Christopher Di Bella e4dd614ae8 [libcxx] cleans up __cpp_concepts mess
libc++ was previously a bit confused by what the value of __cpp_concepts
should be. Also replaces `__floating_point` with `floating_point` now
that it exists.

Differential Revision: https://reviews.llvm.org/D97015
2021-02-26 18:43:40 +00:00
Christopher Di Bella 9f4f6ac94b [libcxx] adds concept `std::uniform_random_bit_generator`
Implements parts of:
    - P0898R3 Standard Library Concepts
    - P1754 Rename concepts to standard_case for C++20, while we still can

Differential Revision: https://reviews.llvm.org/D96577
2021-02-19 01:47:29 +00:00
Christopher Di Bella 17db24a7a8 [libcxx] adds concepts `std::invocable` and `std::regular_invocable`
Implements parts of:
    - P0898R3 Standard Library Concepts
    - P1754 Rename concepts to standard_case for C++20, while we still can

Differential Revision: https://reviews.llvm.org/D96235
2021-02-10 19:35:53 +00:00
Christopher Di Bella c63de225fd [libcxx] adds concept std::derived_from
Implements parts of:
    - P0898R3 Standard Library Concepts
    - P1754 Rename concepts to standard_case for C++20, while we still can

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D74292
2021-02-10 19:30:08 +00:00
Christopher Di Bella bee7b07f23 [libcxx] adds [concepts.arithmetic]
Implements parts of:
    * P0898R3 Standard Library Concepts
    * P1754 Rename concepts to standard_case for C++20, while we still can

Differential Revision: https://reviews.llvm.org/D88131
2021-02-10 19:04:57 +00:00
Christopher Di Bella 2193e8be3e [libcxx] adds concept `std::copy_constructible`
Implements parts of:
    - P0898R3 Standard Library Concepts
    - P1754 Rename concepts to standard_case for C++20, while we still can

Depends on D96230

Differential Revision: https://reviews.llvm.org/D96232
2021-02-10 17:56:42 +00:00
Christopher Di Bella 2b2f36a8b1 [libcxx] adds concept `std::move_constructible`
Implements parts of:
    - P0898R3 Standard Library Concepts
    - P1754 Rename concepts to standard_case for C++20, while we still can

Depends on D77961

Differential Revision: https://reviews.llvm.org/D96230
2021-02-10 17:33:35 +00:00
Christopher Di Bella 8caf835337 [libcxx] adds concept `std::convertible_to`
Implements parts of:
    - P0898R3 Standard Library Concepts
    - P1754 Rename concepts to standard_case for C++20, while we still can

Differential Revision: https://reviews.llvm.org/D77961
2021-02-10 03:27:41 +00:00
Mark de Wever 3ffc53ba16 [libc++] Implements concept default_initializable.
Implements:
- LWG3149 DefaultConstructible should require default initialization

Implements parts of:
 - P0898R3 Standard Library Concepts
 - P1754 Rename concepts to standard_case for C++20, while we still can

Depends on D91986

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D93461
2021-02-01 19:13:24 +01:00
Mark de Wever 18fe3fe0e7 [libc++] Implements concept constructible_from
Implements parts of:
- P0898R3 Standard Library Concepts
- P1754 Rename concepts to standard_case for C++20, while we still can

Depends on: D91004

Reviewed By: ldionne, cjdb, #libc

Differential Revision: https://reviews.llvm.org/D91986
2021-01-28 18:32:47 +01:00
Mark de Wever a8e06361dd [libc++] Implements concept destructible
Implements parts of:
- P0898R3 Standard Library Concepts
- P1754 Rename concepts to standard_case for C++20, while we still can

Reviewed By: ldionne, miscco, #libc

Differential Revision: https://reviews.llvm.org/D91004
2021-01-23 18:17:25 +01:00
Eric Fiselier 601f763182 [libcxx] Adds [concept.same]
Patch from Christopher Di Bella (cjdb@google.com)
Reviewed as https://reviews.llvm.org/D74291

Adds `std::same_as` to libc++. Since there aren't clang-format rules for
//requires-expressions//, I'll need to disable the formatter in certain areas.
2020-04-08 18:00:13 -04:00