boostorg / boostorg/hana

Is it possible to join two functors to one?

Open
#522 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
1.9k
Forks
225
PR merge metrics
No merged PRs in 30d

Description

I'm finding something like this:
```
struct functor_1 {
void operator() (std::string arg1, std::string arg2)
{
std::cout << arg1 << arg2 " from first functor" << std::endl
}
};
struct functor_2 {
void operator() (std::string arg1, std::string arg2)
{
std::cout << arg1 << arg2 " from second functor" << std::endl
}
};
join(functor_1(), functor_2())("Hello, ", "World!"); // will print two lines:
// "Hello, World! from first functor"
// .. and
// "Hello, World! from second functor"
```
Is it possible to do using boost.hana?

Contributor guide

Open the contributing guide

Research direction

The issue names no source file, test, or entry point and is currently a usage question. Start by checking Boost.Hana's callable-composition documentation and examples; a useful resolution would be a confirmed approach or a clearly scoped implementation request with tests, but the payload does not define either.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
developer-experience
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.