aboutsummaryrefslogtreecommitdiffstats
path: root/nihil.generator/elements_of.ccm
diff options
context:
space:
mode:
Diffstat (limited to 'nihil.generator/elements_of.ccm')
-rw-r--r--nihil.generator/elements_of.ccm66
1 files changed, 0 insertions, 66 deletions
diff --git a/nihil.generator/elements_of.ccm b/nihil.generator/elements_of.ccm
deleted file mode 100644
index 74c8b76..0000000
--- a/nihil.generator/elements_of.ccm
+++ /dev/null
@@ -1,66 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// Reference implementation of std::generator proposal P2168.
-//
-// See https://wg21.link/P2168 for details.
-//
-///////////////////////////////////////////////////////////////////////////////
-// Copyright Lewis Baker, Corentin Jabot
-//
-// Use, modification and distribution is subject to the Boost Software License,
-// Version 1.0.
-// (See accompanying file LICENSE or http://www.boost.org/LICENSE_1_0.txt)
-///////////////////////////////////////////////////////////////////////////////
-
-export module nihil.generator:elements_of;
-
-import nihil.std;
-import :util;
-
-namespace nihil {
-
-export template <typename Range, typename Allocator = use_allocator_arg>
-struct elements_of {
- explicit constexpr elements_of(Range &&range) noexcept
- requires std::is_default_constructible_v<Allocator>
- : m_range(static_cast<Range &&>(range))
- {
- }
-
- constexpr elements_of(Range &&range, Allocator &&alloc) noexcept
- : m_range(static_cast<Range &&>(range))
- , m_alloc(static_cast<Allocator &&>(alloc))
- {}
-
- constexpr elements_of(elements_of &&) noexcept = default;
-
- constexpr elements_of(const elements_of &) = delete;
-
- constexpr auto operator=(this elements_of &, const elements_of &)
- -> elements_of & = delete;
- constexpr auto operator=(this elements_of &, elements_of &&) noexcept
- -> elements_of & = delete;
-
- [[nodiscard]] constexpr auto
- get(this elements_of const &self) noexcept -> Range &&
- {
- return static_cast<Range &&>(self.m_range);
- }
-
- [[nodiscard]] constexpr auto
- get_allocator(this elements_of const &self) noexcept -> Allocator
- {
- return self.m_alloc;
- }
-
-private:
- [[no_unique_address]] Allocator m_alloc;
- Range &&m_range;
-};
-
-export template <typename Range>
-elements_of(Range &&) -> elements_of<Range>;
-
-export template <typename Range, typename Allocator>
-elements_of(Range &&, Allocator &&) -> elements_of<Range, Allocator>;
-
-} // namespace nihil