diff options
| author | Lexi Winter <lexi@le-fay.org> | 2025-07-02 05:49:47 +0100 |
|---|---|---|
| committer | Lexi Winter <lexi@le-fay.org> | 2025-07-02 05:49:47 +0100 |
| commit | ebe4cb0bdeabd06a31072547af47cacaab7f78c0 (patch) | |
| tree | 65a81c2c86260b595107ee6c5505583f9afaf39d /nihil.generator/coroutine_traits.ccm | |
| parent | 5adeb648f74c1771164c0686d6e0fc584cf36d9e (diff) | |
| download | nihil-ebe4cb0bdeabd06a31072547af47cacaab7f78c0.tar.gz nihil-ebe4cb0bdeabd06a31072547af47cacaab7f78c0.tar.bz2 | |
replace nihil::generator
the new implementation is much simpler and PD-licensed. the only
downside is it doesn't support elements_of.
while here, move it to nihil.core.
Diffstat (limited to 'nihil.generator/coroutine_traits.ccm')
| -rw-r--r-- | nihil.generator/coroutine_traits.ccm | 66 |
1 files changed, 0 insertions, 66 deletions
diff --git a/nihil.generator/coroutine_traits.ccm b/nihil.generator/coroutine_traits.ccm deleted file mode 100644 index fde4393..0000000 --- a/nihil.generator/coroutine_traits.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:coroutine_traits; - -import nihil.std; -import :byte_allocator; -import :forward; -import :generator_promise; - -namespace std { - -// Type-erased allocator with default allocator behaviour. -export template <typename Ref, typename Value, typename... Args> -struct coroutine_traits<nihil::generator<Ref, Value>, Args...> -{ - using promise_type = - nihil::generator_promise<nihil::generator<Ref, Value>, std::allocator<std::byte>>; -}; - -// Type-erased allocator with std::allocator_arg parameter -export template <typename Ref, typename Value, typename Alloc, typename... Args> -struct coroutine_traits<nihil::generator<Ref, Value>, allocator_arg_t, Alloc, Args...> -{ -private: - using byte_allocator = nihil::byte_allocator_t<Alloc>; - -public: - using promise_type = nihil::generator_promise<nihil::generator<Ref, Value>, byte_allocator, - true /*explicit Allocator*/>; -}; - -// Type-erased allocator with std::allocator_arg parameter (non-static member functions) -export template <typename Ref, typename Value, typename This, typename Alloc, typename... Args> -struct coroutine_traits<nihil::generator<Ref, Value>, This, allocator_arg_t, Alloc, Args...> -{ -private: - using byte_allocator = nihil::byte_allocator_t<Alloc>; - -public: - using promise_type = nihil::generator_promise<nihil::generator<Ref, Value>, byte_allocator, - true /*explicit Allocator*/>; -}; - -// Generator with specified allocator type -export template <typename Ref, typename Value, typename Alloc, typename... Args> -struct coroutine_traits<nihil::generator<Ref, Value, Alloc>, Args...> -{ - using byte_allocator = nihil::byte_allocator_t<Alloc>; - -public: - using promise_type = - nihil::generator_promise<nihil::generator<Ref, Value, Alloc>, byte_allocator>; -}; - -} // namespace std |
