W-Mai / ZongHeng

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

纵横

ZongHeng is opposite theories of vertical and horizontal alliance of states with the state of Qin as pivot in Chinese history.

General Usage

asciicast

#include "Qin.h"
#include <iostream>

using namespace std;

int main() {
    auto hello_str = std::string("Hello ");
    auto hello     = Qin<string>::make(hello_str);
    auto name      = Qin<string>::make();
    auto mark      = Qin<string>::make(" !");
    // 联合`变量`
    auto sentence  = hello + name + mark;

    sentence->getter([](const string& s) {
        return s + " 🤤";
    });

    auto name_tmp = std::string("World");
    do {
        // 一呼百应
        *name = name_tmp;
        cout << sentence->get() << endl;
    } while (cin >> name_tmp);

    return 0;
}

Run Example

mkdir -p build && cd build
cmake .. && make -j
./example

Run Test

mkdir -p build && cd build
cmake .. && make -j
ctest

TODO

  • Support more complex chain
  • Support condition chain
  • ...

Commit Information

means emoji
feature ❤️
fix 🤡
format 🧾
refactor ⚙️
update 🆕
WIP ⌛️

About


Languages

Language:C++ 85.2%Language:CMake 9.5%Language:C 5.3%