Skip to content
asciphx edited this page Mar 2, 2025 · 76 revisions

Welcome to the FabCc wiki!

  • 最近更新: RBTree和时间轮的高性能可撤销计时器🔥,使用黑魔法管理协程内存,避免容器内存消耗等🌌
  • Recent update: High-performance timer based on RBTree and time wheel, which supports undo function🔥.Using dark magic to directly manage the memory of the coroutine to avoid container memory consumption, etc.🌌
  • 2024年4月12号更新c++20协程,支持嵌套,兼容lambda表达式,成功对接旧版函数式协程, 性能比旧版协程强了5%左右。关于编译,gcc或者clang可能需要强制指定set(CMAKE_CXX_STANDARD 20)才能使用c++20.编译器的版本支持情况 gcc >= 9.4(x86-64 gcc >= 10.1), clang >= 10.1, MSVC >= 19.28.29910.
  • Updated the c++20 coroutine on April 12, 2024, supporting nesting and compatibility with lambda expressions. Successfully integrated with the old version of the functional coroutine, the performance is about 5% better than the old coroutine.Regarding compilation, gcc or clang may need to forcefully specify set (CMAKE_CXX_STANDARD 20) to use c++20. Version gcc >= 9.4(x86-64 gcc >= 10.1), clang >= 10.1, MSVC >= 19.28.29910.
  • 思想理念是:鱼和熊掌兼得。既要性能又要干净的代码,只有优点没有缺点,编译又快,运行又不慢,迭代便捷,维护却也不怎么困难。
  • The idea is: have your cake and eat it too. It requires both performance and clean code. It has only advantages and no disadvantages. It is fast to compile, not slow to run, easy to iterate, and not too difficult to maintain.
  • 支持MinGW编译器, cmake -B build -G "MinGW Makefiles"替代 cmake -B build既可。
  • Support MinGW compiler, cmake -B build -G "MinGW Makefiles" can replace cmake -B build.
  • QQ[群]: 1082037157

OOP

struct Book;
struct Person;
struct Book {
  box<std::string> name = "Hello, world!";
  box<Person> person; vec<Person> persons;
  REG
};
REGIS(Book, name, person, persons)
struct Person {
  box<std::string> name;
  box<int> age;
  box<Book> book; vec<Book> books;
  REG
};
REGIS(Person, name, age, book, books)

to_json

  //Write C++ like Object-Oriented Programming
  Book b{ "ts", Person{"js",33, Book{ "plus" }, vec<Book>{ {"1", Person { "sb1" }}, {"2", Person { "sb2" }} }} };
  b.person->book = Book{ "rs" };
  Json x; x = b;

from_json

  Json x = json::parse(R"(
{"name":"ts","person":{"name":"js","age":33,"book":{"name":"ojbk","person":{"name":"fucker","age":0},
"persons":[{"name":"stupid","age":1},{"name":"idoit","age":2},{"name":"bonkers","age":3,"book":{"name":"sb"}}]}}}
)"); Book b = x.get<Book>();
  b.person->book->persons[2].name = "wwzzgg";//set obj proto
Clone this wiki locally