Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move the TReadHandler template parameter before TWriteHandler template parameter in LinksOptions #345

Closed
FreePhoenix888 opened this issue Apr 15, 2022 · 7 comments
Assignees
Labels

Comments

@FreePhoenix888
Copy link
Member

template<typename TLinkAddress = std::uint64_t, LinksConstants<TLinkAddress> VConstants = LinksConstants<TLinkAddress>{true}, typename TLink = std::vector<TLinkAddress>, typename TWriteHandler = std::function<TLinkAddress(TLink, TLink)>, typename TReadHandler = std::function<TLinkAddress(TLink)>>

@FreePhoenix888 FreePhoenix888 self-assigned this Apr 15, 2022
@FreePhoenix888
Copy link
Member Author

linksplatform/Data#118

@uselessgoddess
Copy link
Member

Move TReadHandler/TWriteHandler to trash

@FreePhoenix888
Copy link
Member Author

Move TReadHandler/TWriteHandler to trash

Why?

@uselessgoddess
Copy link
Member

uselessgoddess commented Jul 11, 2022

C++ cannot accept as parameter Options<TReadHandler = impl ReadFn(Signature), TWriteHandler = impl WriteFn(Signature)>.
We need to accept function concepts (and use std::function<Signature> to pass handlers in dynamic interface)

@Konard
Copy link
Member

Konard commented Jul 11, 2022

@uselessgoddess can you give us a code example? What does impl mean in the context of C++?

@uselessgoddess
Copy link
Member

implements. Sorry i Java-lover. Wait some minutes, I give example

@uselessgoddess
Copy link
Member

This is how you can represent concept as template argument
https://godbolt.org/z/P3dM3nfae

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants