Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ target_sources(
include/stdx/intrusive_list.hpp
include/stdx/iterator.hpp
include/stdx/latched.hpp
include/stdx/memory.hpp
include/stdx/numeric.hpp
include/stdx/optional.hpp
include/stdx/panic.hpp
Expand Down
4 changes: 0 additions & 4 deletions docs/header_graph.mmd
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ flowchart BT
type_traits --> ct_conversions

%% level 3
memory(<a href="https://github.com/intel/cpp-std-extensions/tree/main/include/stdx/memory.hpp">memory.hpp</a>)
memory --> type_traits
iterator(<a href="https://github.com/intel/cpp-std-extensions/tree/main/include/stdx/iterator.hpp">iterator.hpp</a>)
iterator --> type_traits
concepts(<a href="https://github.com/intel/cpp-std-extensions/tree/main/include/stdx/concepts.hpp">concepts.hpp</a>)
Expand Down Expand Up @@ -53,11 +51,9 @@ flowchart BT

%% level 6
span(<a href="https://github.com/intel/cpp-std-extensions/tree/main/include/stdx/span.hpp">span.hpp</a>)
span ----> memory
span ----> iterator
span --> bit
byterator(<a href="https://github.com/intel/cpp-std-extensions/tree/main/include/stdx/byterator.hpp">byterator.hpp</a>)
byterator ----> memory
byterator --> bit
cx_set(<a href="https://github.com/intel/cpp-std-extensions/tree/main/include/stdx/cx_set.hpp">cx_set.hpp</a>)
cx_set ---> cx_map
Expand Down
1 change: 0 additions & 1 deletion docs/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ include::intrusive_forward_list.adoc[]
include::intrusive_list.adoc[]
include::iterator.adoc[]
include::latched.adoc[]
include::memory.adoc[]
include::numeric.adoc[]
include::optional.adoc[]
include::panic.adoc[]
Expand Down
1 change: 0 additions & 1 deletion docs/intro.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ The following headers are available:
* https://github.com/intel/cpp-std-extensions/blob/main/include/stdx/intrusive_list.hpp[`intrusive_list.hpp`]
* https://github.com/intel/cpp-std-extensions/blob/main/include/stdx/iterator.hpp[`iterator.hpp`]
* https://github.com/intel/cpp-std-extensions/blob/main/include/stdx/latched.hpp[`latched.hpp`]
* https://github.com/intel/cpp-std-extensions/blob/main/include/stdx/memory.hpp[`memory.hpp`]
* https://github.com/intel/cpp-std-extensions/blob/main/include/stdx/numeric.hpp[`numeric.hpp`]
* https://github.com/intel/cpp-std-extensions/blob/main/include/stdx/optional.hpp[`optional.hpp`]
* https://github.com/intel/cpp-std-extensions/blob/main/include/stdx/panic.hpp[`panic.hpp`]
Expand Down
7 changes: 0 additions & 7 deletions docs/memory.adoc

This file was deleted.

9 changes: 4 additions & 5 deletions include/stdx/byterator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@

#include <stdx/bit.hpp>
#include <stdx/concepts.hpp>
#include <stdx/memory.hpp>
#include <stdx/type_traits.hpp>
#include <stdx/utility.hpp>

#include <cstddef>
#include <cstring>
#include <functional>
#include <iterator>
#include <memory>
#include <type_traits>

namespace stdx {
Expand Down Expand Up @@ -45,7 +44,7 @@ template <typename T> class byterator {
[[nodiscard]] friend constexpr auto operator==(byterator const &x, It y)
-> bool {
return static_cast<void const *>(x.ptr) ==
static_cast<void const *>(stdx::to_address(y));
static_cast<void const *>(std::to_address(y));
}

[[nodiscard]] friend constexpr auto operator<=>(byterator const &x,
Expand All @@ -56,7 +55,7 @@ template <typename T> class byterator {
requires std::is_same_v<detail::iterator_value_t<It>, T>
[[nodiscard]] friend constexpr auto operator<=>(byterator const &x, It y) {
return static_cast<void const *>(x.ptr) <=>
static_cast<void const *>(stdx::to_address(y));
static_cast<void const *>(std::to_address(y));
}

public:
Expand All @@ -67,7 +66,7 @@ template <typename T> class byterator {
using iterator_category = std::random_access_iterator_tag;

template <detail::byteratorish It>
explicit byterator(It it) : ptr(bit_cast<byte_t *>(stdx::to_address(it))) {}
explicit byterator(It it) : ptr(bit_cast<byte_t *>(std::to_address(it))) {}

[[nodiscard]] constexpr auto operator->() const -> byte_t * { return ptr; }
[[nodiscard]] constexpr auto operator*() const -> byte_t & { return *ptr; }
Expand Down
33 changes: 0 additions & 33 deletions include/stdx/memory.hpp

This file was deleted.

10 changes: 5 additions & 5 deletions include/stdx/span.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
#include <stdx/compiler.hpp>
#include <stdx/concepts.hpp>
#include <stdx/iterator.hpp>
#include <stdx/memory.hpp>
#include <stdx/type_traits.hpp>

#include <algorithm>
#include <array>
#include <cstddef>
#include <iterator>
#include <limits>
#include <memory>
#include <type_traits>

namespace stdx {
Expand Down Expand Up @@ -85,12 +85,12 @@ class span : public detail::span_base<T, Extent> {
template <typename It, typename SizeOrEnd>
requires(dependent_extent<It> != dynamic_extent)
explicit constexpr span(It first, SizeOrEnd)
: ptr{stdx::to_address(first)} {}
: ptr{std::to_address(first)} {}

template <typename It, typename SizeOrEnd>
requires(dependent_extent<It> == dynamic_extent)
constexpr span(It first, SizeOrEnd sore)
: base_t{first, sore}, ptr{stdx::to_address(first)} {}
: base_t{first, sore}, ptr{std::to_address(first)} {}

template <typename U, std::size_t N>
constexpr explicit(false) span(std::array<U, N> &arr LIFETIMEBOUND) noexcept
Expand Down Expand Up @@ -120,13 +120,13 @@ class span : public detail::span_base<T, Extent> {
template <typename R>
requires(dependent_extent<R> != dynamic_extent)
explicit constexpr span(R &&r)
: ptr{stdx::to_address(std::begin(std::forward<R>(r)))} {}
: ptr{std::to_address(std::begin(std::forward<R>(r)))} {}

template <typename R>
requires(dependent_extent<R> == dynamic_extent)
explicit constexpr span(R &&r)
: base_t{std::begin(std::forward<R>(r)), std::end(std::forward<R>(r))},
ptr{stdx::to_address(std::begin(std::forward<R>(r)))} {}
ptr{std::to_address(std::begin(std::forward<R>(r)))} {}

template <class U, std::size_t N>
requires(dependent_extent<U> != dynamic_extent and N == dynamic_extent)
Expand Down
1 change: 0 additions & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ add_tests(
is_constant_evaluated
iterator
latched
memory
numeric
optional
overload
Expand Down
5 changes: 3 additions & 2 deletions test/byterator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@

#include <array>
#include <iterator>
#include <memory>

TEST_CASE("constructible from an iterator", "[byterator]") {
auto const a = std::array{1, 2, 3, 4};
auto const b = stdx::byterator{std::begin(a)};
CHECK(static_cast<void const *>(stdx::to_address(std::begin(a))) ==
static_cast<void const *>(stdx::to_address(b)));
CHECK(static_cast<void const *>(std::to_address(std::begin(a))) ==
static_cast<void const *>(std::to_address(b)));
}

TEST_CASE("equality comparable to iterator", "[byterator]") {
Expand Down
1 change: 0 additions & 1 deletion test/fail/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ add_fail_tests(
subspan_too_big
subspan_wrapping
template_for_each_not_list
to_address_undefined_on_function
tuple_index_out_of_bounds
tuple_equality_mismatch
tuple_equality_with_element
Expand Down
9 changes: 0 additions & 9 deletions test/fail/to_address_undefined_on_function.cpp

This file was deleted.

54 changes: 0 additions & 54 deletions test/memory.cpp

This file was deleted.

5 changes: 3 additions & 2 deletions test/span.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <cstddef>
#include <cstdint>
#include <iterator>
#include <memory>
#include <type_traits>

TEMPLATE_TEST_CASE("span exposes types", "[span]", std::uint8_t,
Expand Down Expand Up @@ -418,7 +419,7 @@ TEST_CASE("subspan of span", "[span]") {
constexpr auto s6 = s1.subspan<4, 0>();
STATIC_REQUIRE(
std::is_same_v<decltype(s6), stdx::span<int const, 0> const>);
STATIC_REQUIRE(std::data(s6) == stdx::to_address(std::end(a)));
STATIC_REQUIRE(std::data(s6) == std::to_address(std::end(a)));
}

TEST_CASE("subspan of dynamic span", "[span]") {
Expand All @@ -445,7 +446,7 @@ TEST_CASE("subspan of dynamic span", "[span]") {

auto s6 = s1.subspan<4, 0>();
STATIC_REQUIRE(std::is_same_v<decltype(s6), stdx::span<int, 0>>);
CHECK(std::data(s6) == stdx::to_address(std::end(a)));
CHECK(std::data(s6) == std::to_address(std::end(a)));
}

TEST_CASE("span is explicitly convertible from dynamic to fixed", "[span]") {
Expand Down
1 change: 0 additions & 1 deletion usage_test/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include <stdx/intrusive_list.hpp>
#include <stdx/iterator.hpp>
#include <stdx/latched.hpp>
#include <stdx/memory.hpp>
#include <stdx/numeric.hpp>
#include <stdx/optional.hpp>
#include <stdx/panic.hpp>
Expand Down