ReactivePlusPlus
One more implementation of ReactiveX approach in C++ with care about performance and templates in mind
 
Loading...
Searching...
No Matches
flat_map.hpp
1// ReactivePlusPlus library
2//
3// Copyright Aleksey Loginov 2022 - present.
4// Distributed under the Boost Software License, Version 1.0.
5// (See accompanying file LICENSE_1_0.txt or copy at
6// https://www.boost.org/LICENSE_1_0.txt)
7//
8// Project home: https://github.com/victimsnino/ReactivePlusPlus
9//
10
11#pragma once
12
13#include <rpp/operators/map.hpp>
14#include <rpp/operators/merge.hpp>
15#include <rpp/operators/fwd/flat_map.hpp>
16
17IMPLEMENTATION_FILE(flat_map_tag);
18
19namespace rpp::details
20{
21template<constraint::decayed_type Type, flat_map_callable<Type> Callable>
22auto flat_map_impl(auto&& observable, Callable&& callable)
23{
24 return std::forward<decltype(observable)>(observable)
25 .map(std::forward<Callable>(callable))
26 .merge();
27}
28} // namespace rpp::details