netcan / netcan.github.io

My blog for something about programming.
https://netcan.github.io/
2 stars 1 forks source link

C++ 元编程之 Parser Combinator | Netcan on Programming #7

Open netcan opened 4 years ago

netcan commented 4 years ago

https://netcan.github.io/2020/09/16/C-%E5%85%83%E7%BC%96%E7%A8%8B%E4%B9%8BParser-Combinator/

引子 前不久在 CppCon 上看到一个 Talk:constexpr All the things,这个演讲主题令我非常震撼,在编译期解析 json 字符串,进而提出了编译期构造正则表达式(编译期构建 FSM),现场掌声一片,而背后依靠的是 C++ 强大的 constexpr 特性,从而大大提高了编译期计算威力。 早在 C++11 的时候就有 constexpr 特性,那时候约束比较多,只能有一

SteveShaw commented 3 years ago

You should use s.data() not s.begin() for string_view

VhRvo commented 2 years ago

没有 Parser_t 的定义呀

netcan commented 2 years ago

没有 Parser_t 的定义呀

参考https://github.com/netcan/recipes/blob/master/cpp/metaproggramming/parser_combinator/ParserCombinator.hpp#L36