Comments (7)
""_sig
only accepts string from compile-time, it needs changes to support runtime signature parsing.
from sigmatch.
OK, I've changed the title to represent a feature request instead, assuming you are OK with that... if not I can try to fork and see if I can manipulate the existing code to implement it myself, but to be honest your C++ is much more advanced than my understanding, I haven't learned many of these newer features.
from sigmatch.
Some hints:
-
Changing the
consteval
toconstexpr
for all function involved in_sig
function, this makes them can be called at both runtime and compile-time. -
During the first step, you need to figure out how to reimplement the macro
SIGMATCH_CONSTEVAL_STATIC_ASSERT
in order to report an error to caller for runtime parsing. (Probably have to useif constexpr
andstd::is_constant_evaluated
) -
Make a static member function for
signature
for runtime parsing, e.g.signature signature::parse(std::string_view) noexcept
Feel free to try it out if you wish, just make it work for yourself and then you can learn a lot from it ;)
I will try to officially implement it in this repo after I finish my other work.
from sigmatch.
Thanks for the tips, I've messed with it for a while but I need to go learn more modern C++; I think I probably learned on C++98...
from sigmatch.
@SpriteOvO if I can bother you for another hint, I've spent some more time on this and where I'm stuck right now is what the heck to do with consteval_str_buffer... since it takes size as a template arg and that needs to be a compile time constant; am I looking at this in the wrong way, or do I just need to add a second struct with a dynamically sized array?
from sigmatch.
do I just need to add a second struct with a dynamically sized array?
@MattMills No, constexpr
can handle std::string_view
well, so consteval_str_buffer
is only needed for the entry consteval
function parse_sig_str
. For deeper functions, the NTTP consteval_str_buffer
can be simply replaced with a normal parameter std::string_view
.
Don't worry, I have started trying implement it in this repo officially.
from sigmatch.
Implemented in #5.
from sigmatch.
Related Issues (4)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sigmatch.