当前位置: 软件>C/C++软件
Reactive 编程库 C++React
本文导语: C++React 是 C++11 的一个 Reactive 编程库。 示例代码: using namespace std; using namespace react; // Defines a reactive domain that uses single-threaded, sequential updating REACTIVE_DOMAIN(D, sequential) // Defines aliases for types of the given domain, // e....
C++React 是 C++11 的一个 Reactive 编程库。
示例代码:
using namespace std;
using namespace react;
// Defines a reactive domain that uses single-threaded, sequential updating
REACTIVE_DOMAIN(D, sequential)
// Defines aliases for types of the given domain,
// e.g. using VarSignalT = VarSignal
USING_REACTIVE_DOMAIN(D)
// Two reactive variables that can be manipulated imperatively
// to input external changes
VarSignalT width = MakeVar(1);
VarSignalT height = MakeVar(2);
// A signal that depends on width and height and multiplies their values
SignalT area = MakeSignal(
With(width, height),
[] (int w, int h) {
return w * h;
});
您可能感兴趣的文章:
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。