bowenfu / matchit.cpp Goto Github PK
View Code? Open in Web Editor NEWmatch(it): A lightweight single-header pattern-matching library for C++17 with macro-free APIs.
Home Page: https://bowenfu.github.io/matchit.cpp
License: Apache License 2.0
match(it): A lightweight single-header pattern-matching library for C++17 with macro-free APIs.
Home Page: https://bowenfu.github.io/matchit.cpp
License: Apache License 2.0
As a conan user I wanted to have this library awailable via conan-center-index. So I made a PR in there.
@gnuherdnix 's original sample
https://godbolt.org/z/jjh6Kf1b8
Adapted:
https://godbolt.org/z/fdrPac3nM
Describe the solution you'd like
I would like to see this library added as a package for vcpkg.
Describe alternatives you've considered
Adding a header file is extremely convenient, but adding the package to vcpkg would provide automatic fixes and features for users.
Additional context
Since the library uses CMake already, I think the packaging for vcpkg shouldn't be difficult.
Thanks for the great effort!
Could having to use id variables be replaced with lambda parameters?
eg: instead of this
Id<string> text;
match(variant)(
pattern | as<string>(text) = [&] {
std::cout << "Text message: " << *text << std::endl;
})
this
match(variant)(
pattern | as<string> = [](const string& text) {
std::cout << "Text message: " << text << std::endl;
})
This is similar to ref (mut) patterns in rust.
This is a follow up task of #95
Optimize the memory usage and save some copies.
Also pave the path to better support mutation in the handler.
Describe the bug
CMakeLists.txt
is only compatible with use via FetchContent, not with the default idiomatic method of installing the package.
Additional context
Read about CMake installation support, for example, here.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.