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

Make TLink out of LinkType #116

Open
Konard opened this issue Apr 14, 2022 · 1 comment
Open

Make TLink out of LinkType #116

Konard opened this issue Apr 14, 2022 · 1 comment

Comments

@Konard
Copy link
Member

Konard commented Apr 14, 2022

template<typename TLinkAddress = std::uint64_t, typename TWriteHandler = std::function<TLinkAddress(std::vector<TLinkAddress>, std::vector<TLinkAddress>)>, typename TReadHandler = std::function<TLinkAddress(std::vector<TLinkAddress>)>, LinksConstants<TLinkAddress> VConstants = LinksConstants<TLinkAddress>{true}>
struct LinksOptions
{
using LinkAddressType = TLinkAddress;
using LinkType = std::vector<LinkAddressType>;
using WriteHandlerType = TWriteHandler;
using ReadHandlerType = TReadHandler;
static constexpr LinksConstants<LinkAddressType> Constants = VConstants;
};

 template<typename TLinkAddress = std::uint64_t, typename TLink = std::vector<TLinkAddress>, typename TWriteHandler = std::function<TLinkAddress(TLink, TLink)>, typename TReadHandler = std::function<TLinkAddress(TLink)>, LinksConstants<TLinkAddress> VConstants = LinksConstants<TLinkAddress>{true}> 
 struct LinksOptions 
 { 
     using LinkAddressType = TLinkAddress; 
     using LinkType = TLink; 
     using WriteHandlerType = TWriteHandler; 
     using ReadHandlerType = TReadHandler; 
     static constexpr LinksConstants<LinkAddressType> Constants = VConstants; 
 }; 

This change will reduce duplication in code and will make LinksOptions more adjustable by user.

@uselessgoddess
Copy link
Member

typename TLinkAddress = std::uint64_t

Please remove = std::uint64_t

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

No branches or pull requests

2 participants