C++React: A reactive programming library for C++11.

Overview

C++React

C++React is reactive programming library for C++14. It enables the declarative definition of data dependencies between state and event flows. Based on these definitions, propagation of changes is handled automatically.

Here's a simple example:

using namespace react;

void AddNumbers(int a, int b)  { return a + b; }

// Two state variable objects. You can change their values manually.
auto a = StateVar<int>::Create(0);
auto b = StateVar<int>::Create(0);

// Another state object. Its value is calculated automatically based on the given function and arguments.
// If the arguments change, the value is re-calculated.
auto sum = State<int>::Create(AddNumbers, a, b);

// sum == 0
a.Set(21);
// sum == 21
b.Set(21);
// sum == 42

The underlying system constructs a dependency graph to collect which values are affected by a change, and in which order they have to be re-calculated. This guarantees several properties:

  • correctness - no updates are forgotten;
  • consistency - no value is updated before all its incoming dependencies have been updated;
  • efficiency - no value is re-calculated more than once per update cycle, and changes are only propagated along paths where a new value is different from the old one.

The system also knows when it's safe to update values in parallel from multiple threads, and it can do live profiling to decide when that's worthwhile.

Development status

I'm currently in the process of rewriting the library more or less from scratch and many things are still broken or outdated.

The old, but stable and documented version is still available in this branch.

Comments
  • Paralell domain: signals doesn't seem to parallelize

    Paralell domain: signals doesn't seem to parallelize

    Probably I misunderstand how parallelizing signals should be done. My issue is that the code below doesn't seem to parallelize. It is the example code from the README. As for the doCostlyOperation, it just sleeps for 1 second.

    #include <cmath>
    #include <functional>
    #include <iostream>
    #include <string>
    #include <utility>
    #include <vector>
    
    #if defined(WIN32)
    #include <windows.h>
    #elif !defined(WIN32)
    #include <unistd.h>
    void Sleep(int ms) {
        usleep(1000*ms);
    }
    #endif
    
    #include <react/Domain.h>
    #include <react/Signal.h>
    #include <react/Observer.h>
    
    
    using namespace std;
    using namespace react;
    
    REACTIVE_DOMAIN(D, parallel)
    USING_REACTIVE_DOMAIN(D)
    
    int doCostlyOperation(int in) {
        std::cout << "do  " << in << std::endl;
        Sleep(1000);
        std::cout << "end " << in << std::endl;
    
        return in;
    }
    
    VarSignalT<int> in = MakeVar<D>(0);
    
    SignalT<int> op1 = MakeSignal(in,
        [] (int in) {
            return doCostlyOperation(in);
        });
    
    SignalT<int> op2 = MakeSignal(in,
        [] (int in) {
            return doCostlyOperation(in);
        });
    
    // op1 and op2 can be re-calculated in parallel
    SignalT<int> out = op1 + op2;
    
    
    int main()
    {
        in <<= 2;
    }
    

    The output I get is this:

    do  0
    end 0
    do  0
    end 0
    do  2
    end 2
    do  2
    end 2
    

    Sleeps happen here:

    do  0 # after this line  
    end 0
    do  0 # after this line
    end 0
    do  2 # after this line
    end 2
    do  2 # after this line
    end 2
    

    I would expect the code above to do some of the tasks in parallel, but currently it acts as if it were sequential.

    opened by klaufir 2
  • Is lazy node supported?

    Is lazy node supported?

    In the paper "Deprecating the Observer Pattern with Scala.React" there's a section "Strict vs Lazy Nodes", quoting from the paper:

    Lazy nodes are notified by their dependencies eagerly, but validated only when queried

    My simple test showed that C++React evaluates the nodes when notified even though no one queries. Is lazy node implemented? If not, is there any plan? or is it impossible for C++React?

    opened by jamboree 2
  • possible bug in EngineInterface

    possible bug in EngineInterface

    ///////////////////////////////////////////////////////////////////////////////////////////////////
    /// EngineInterface - Static wrapper for IReactiveEngine
    ///////////////////////////////////////////////////////////////////////////////////////////////////
    template
    <
        typename D,
        typename TEngine
    >
    struct EngineInterface
    {
        static void OnTurnAdmissionStart(TurnT& turn)
        {
            Instance().OnTurnAdmissionEnd(turn); // <-- is this a bug? should it call *Start* not *End*?
        }
    
    opened by steve-lorimer 1
  • compile error on osx with clang

    compile error on osx with clang

    Hey, trying to compile cpp.react with clang 3.5.1 or clang 3.4.2 on OSX 10.9.5 shows the following error:

    /Path/EventLog.cpp:18 
    /Path/EventLog.cpp:18:5:  
    error: no matching constructor for initialization of 'TimestampT' (aka 'time_point<std::chrono::high_resolution_clock>')
    :5: error: no matching constructor for initialization of 'TimestampT' (aka 'time_point<std::chrono::high_resolution_clock>')
        time_{ std::chrono::system_clock::now() },
        ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        time_{ std::chrono::system_clock::now() },
        ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/local/Cellar/llvm/3.5.1/bin/../include/c++/v1/chrono:750:/usr/local/Cellar/llvm/3.5.1/bin/../include/c++/v1/chrono:750:29: note: 29: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'time_point' (aka 'time_point<std::__1::chrono::system_clock>') to 'const std::__1::chrono::time_point<std::__1::chrono::steady_clock, std::__1::chrono::duration<long long, std::__1::ratio<1, 1000000000> > > &' for 1st argument
    candidate constructor (the implicit copy constructor) not viable: no known conversion from 'time_point' (aka 'time_point<std::__1::chrono::system_clock>') to 'const std::__1::chrono::time_point<std::__1::chrono::steady_clock, std::__1::chrono::duration<long long, std::__1::ratio<1, 1000000000> > > &' for 1st argument
    class _LIBCPP_TYPE_VIS_ONLY time_point
                                ^class _LIBCPP_TYPE_VIS_ONLY time_point
                                ^
    
    /usr/local/Cellar/llvm/3.5.1/bin/../include/c++/v1/chrono:750/usr/local/Cellar/llvm/3.5.1/bin/../include/c++/v1/chrono:750:29: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'time_point' (aka 'time_point<std::__1::chrono::system_clock>') to 'std::__1::chrono::time_point<std::__1::chrono::steady_clock, std::__1::chrono::duration<long long, std::__1::ratio<1, 1000000000> > > &&' for 1st argument
    :29: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'time_point' (aka 'time_point<std::__1::chrono::system_clock>') to 'std::__1::chrono::time_point<std::__1::chrono::steady_clock, std::__1::chrono::duration<long long, std::__1::ratio<1, 1000000000> > > &&' for 1st argument
    class _LIBCPP_TYPE_VIS_ONLY time_point
                                ^class _LIBCPP_TYPE_VIS_ONLY time_point
                                ^
    
    /usr/local/Cellar/llvm/3.5.1/bin/../include/c++/v1/chrono:764/usr/local/Cellar/llvm/3.5.1/bin/../include/c++/v1/chrono:764:70: :70: note: candidate constructor not viable: no known conversion from 'time_point' (aka 'time_point<std::__1::chrono::system_clock>') to 'const duration' (aka 'const std::__1::chrono::duration<long long, std::__1::ratio<1, 1000000000> >') for 1st argument
    note: candidate constructor not viable: no known conversion from 'time_point' (aka 'time_point<std::__1::chrono::system_clock>') to 'const duration' (aka 'const std::__1::chrono::duration<long long, std::__1::ratio<1, 1000000000> >') for 1st argument
        _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 explicit time_point(const duration& __d) : __d_(__d) {}
                                                                         ^
        _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 explicit time_point(const duration& __d) : __d_(__d) {}
                                                                         ^
    /usr/local/Cellar/llvm/3.5.1/bin/../include/c++/v1/chrono:769:5: /usr/local/Cellar/llvm/3.5.1/bin/../include/c++/v1/chrono:769:5: note: candidate template ignored: could not match 'std::__1::chrono::steady_clock' against 'std::__1::chrono::system_clock'
    note: candidate template ignored: could not match 'std::__1::chrono::steady_clock' against 'std::__1::chrono::system_clock'
        time_point(const time_point<clock, _Duration2>& t,
        ^
        time_point(const time_point<clock, _Duration2>& t,
        ^
    /usr/local/Cellar/llvm/3.5.1/bin/../include/c++/v1/chrono:763:61: note: candidate constructor not viable: requires 0 arguments, but 1 was provided
    /usr/local/Cellar/llvm/3.5.1/bin/../include/c++/v1/chrono:763:61: note: candidate constructor not viable: requires 0 arguments, but 1 was provided
        _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 time_point() : __d_(duration::zero()) {}
                                                                ^    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 time_point() : __d_(duration::zero()) {}
                                                                ^
    
    /Users/lx/Documents/Text/Code/C_Languages/_frameworks/cpp.react/src/logging/EventLog.cpp:30/Users/lx/Documents/Text/Code/C_Languages/_frameworks/cpp.react/src/logging/EventLog.cpp:30:5: error: :5: error: no matching constructor for initialization of 'TimestampT' (aka 'time_point<std::chrono::high_resolution_clock>')
    no matching constructor for initialization of 'TimestampT' (aka 'time_point<std::chrono::high_resolution_clock>')
        time_{ std::chrono::system_clock::now() },
        ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    time_{ std::chrono::system_clock::now() },
        ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    /usr/local/Cellar/llvm/3.5.1/bin/../include/c++/v1/chrono:750:/usr/local/Cellar/llvm/3.5.1/bin/../include/c++/v1/chrono:750:29: note: 29: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'time_point' (aka 'time_point<std::__1::chrono::system_clock>') to 'const std::__1::chrono::time_point<std::__1::chrono::steady_clock, std::__1::chrono::duration<long long, std::__1::ratio<1, 1000000000> > > &' for 1st argument
    candidate constructor (the implicit copy constructor) not viable: no known conversion from 'time_point' (aka 'time_point<std::__1::chrono::system_clock>') to 'const std::__1::chrono::time_point<std::__1::chrono::steady_clock, std::__1::chrono::duration<long long, std::__1::ratio<1, 1000000000> > > &' for 1st argument
    class _LIBCPP_TYPE_VIS_ONLY time_point
                                ^class _LIBCPP_TYPE_VIS_ONLY time_point
                                ^
    
    /usr/local/Cellar/llvm/3.5.1/bin/../include/c++/v1/chrono:750:29: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'time_point' (aka 'time_point<std::__1::chrono::system_clock>') to 'std::__1::chrono::time_point<std::__1::chrono::steady_clock, std::__1::chrono::duration<long long, std::__1::ratio<1, 1000000000> > > &&' for 1st argument
    /usr/local/Cellar/llvm/3.5.1/bin/../include/c++/v1/chrono:750:29: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'time_point' (aka 'time_point<std::__1::chrono::system_clock>') to 'std::__1::chrono::time_point<std::__1::chrono::steady_clock, std::__1::chrono::duration<long long, std::__1::ratio<1, 1000000000> > > &&' for 1st argument
    class _LIBCPP_TYPE_VIS_ONLY time_point
                                ^class _LIBCPP_TYPE_VIS_ONLY time_point
                                ^
    
    /usr/local/Cellar/llvm/3.5.1/bin/../include/c++/v1/chrono:764:70: /usr/local/Cellar/llvm/3.5.1/bin/../include/c++/v1/chrono:764:70: note: candidate constructor not viable: no known conversion from 'time_point' (aka 'time_point<std::__1::chrono::system_clock>') to 'const duration' (aka 'const std::__1::chrono::duration<long long, std::__1::ratio<1, 1000000000> >') for 1st argument
    note: candidate constructor not viable: no known conversion from 'time_point' (aka 'time_point<std::__1::chrono::system_clock>') to 'const duration' (aka 'const std::__1::chrono::duration<long long, std::__1::ratio<1, 1000000000> >') for 1st argument
        _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 explicit time_point(const duration& __d) : __d_(__d) {}
                                                                         ^    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 explicit time_point(const duration& __d) : __d_(__d) {}
                                                                         ^
    
    /usr/local/Cellar/llvm/3.5.1/bin/../include/c++/v1/chrono:769:/usr/local/Cellar/llvm/3.5.1/bin/../include/c++/v1/chrono:769:5: note: 5: note: candidate template ignored: could not match 'std::__1::chrono::steady_clock' against 'std::__1::chrono::system_clock'
    candidate template ignored: could not match 'std::__1::chrono::steady_clock' against 'std::__1::chrono::system_clock'
        time_point(const time_point<clock, _Duration2>& t,
        ^    time_point(const time_point<clock, _Duration2>& t,
        ^
    /usr/local/Cellar/llvm/3.5.1/bin/../include/c++/v1/chrono:763:61:
    /usr/local/Cellar/llvm/3.5.1/bin/../include/c++/v1/chrono:763:61: note: candidate constructor not viable: requires 0 arguments, but 1 was provided
     note: candidate constructor not viable: requires 0 arguments, but 1 was provided
        _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 time_point() : __d_(duration::zero()) {}
                                                                ^    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 time_point() : __d_(duration::zero()) {}
                                                                ^
    
    /Users/lx/Documents/Text/Code/C_Languages/_frameworks/cpp.react/src/logging/EventLog.cpp:57:5: error: no matching constructor for initialization of 'TimestampT' (aka 'time_point<std::chrono::high_resolution_clock>')
    /Users/lx/Documents/Text/Code/C_Languages/_frameworks/cpp.react/src/logging/EventLog.cpp:57:5: error: no matching constructor for initialization of 'TimestampT' (aka 'time_point<std::chrono::high_resolution_clock>')
        startTime_(std::chrono::system_clock::now())
        ^          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    startTime_(std::chrono::system_clock::now())
        ^          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    /usr/local/Cellar/llvm/3.5.1/bin/../include/c++/v1/chrono:750:29: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'time_point<std::__1::chrono::system_clock, duration<[...], ratio<[...], 1000000>>>' to 'const time_point<std::__1::chrono::steady_clock, duration<[...], ratio<[...], 1000000000>>>' for 1st argument
    /usr/local/Cellar/llvm/3.5.1/bin/../include/c++/v1/chrono:750:29: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'time_point<std::__1::chrono::system_clock, duration<[...], ratio<[...], 1000000>>>' to 'const time_point<std::__1::chrono::steady_clock, duration<[...], ratio<[...], 1000000000>>>' for 1st argument
    class _LIBCPP_TYPE_VIS_ONLY time_point
                                ^
    class _LIBCPP_TYPE_VIS_ONLY time_point
                                ^
    /usr/local/Cellar/llvm/3.5.1/bin/../include/c++/v1/chrono:750:29: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'time_point<std::__1::chrono::system_clock, duration<[...], ratio<[...], 1000000>>>' to 'time_point<std::__1::chrono::steady_clock, duration<[...], ratio<[...], 1000000000>>>' for 1st argument
    /usr/local/Cellar/llvm/3.5.1/bin/../include/c++/v1/chrono:750:29: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'time_point<std::__1::chrono::system_clock, duration<[...], ratio<[...], 1000000>>>' to 'time_point<std::__1::chrono::steady_clock, duration<[...], ratio<[...], 1000000000>>>' for 1st argument
    class _LIBCPP_TYPE_VIS_ONLY time_point
                                ^
    class _LIBCPP_TYPE_VIS_ONLY time_point
                                ^
    /usr/local/Cellar/llvm/3.5.1/bin/../include/c++/v1/chrono:764:70: note/usr/local/Cellar/llvm/3.5.1/bin/../include/c++/v1/chrono:764:70: note: candidate constructor not viable: no known conversion from 'time_point' (aka 'time_point<std::__1::chrono::system_clock>') to 'const duration' (aka 'const std::__1::chrono::duration<long long, std::__1::ratio<1, 1000000000> >') for 1st argument
    : candidate constructor not viable: no known conversion from 'time_point' (aka 'time_point<std::__1::chrono::system_clock>') to 'const duration' (aka 'const std::__1::chrono::duration<long long, std::__1::ratio<1, 1000000000> >') for 1st argument
        _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 explicit time_point(const duration& __d) : __d_(__d) {}
                                                                         ^
    /usr/local/Cellar/llvm/3.5.1/bin/../include/c++/v1/chrono:769:5: note:     _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 explicit time_point(const duration& __d) : __d_(__d) {}
                                                                         ^
    /usr/local/Cellar/llvm/3.5.1/bin/../include/c++/v1/chrono:769:5: note: candidate template ignored: could not match 'std::__1::chrono::steady_clock' against 'std::__1::chrono::system_clock'
    candidate template ignored: could not match 'std::__1::chrono::steady_clock' against 'std::__1::chrono::system_clock'
        time_point(const time_point<clock, _Duration2>& t,
        ^
    /usr/local/Cellar/llvm/3.5.1/bin/../include/c++/v1/chrono:    time_point(const time_point<clock, _Duration2>& t,
        ^
    /usr/local/Cellar/llvm/3.5.1/bin/../include/c++/v1/chrono:763:61: 763:61: note: candidate constructor not viable: requires 0 arguments, but 1 was provided
    note: candidate constructor not viable: requires 0 arguments, but 1 was provided
        _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 time_point() : __d_(duration::zero()) {}
                                                                ^
        _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 time_point() : __d_(duration::zero()) {}
                                                                ^
    3 errors generated.
    3 errors generated.
    make[2]: make[2]: *** [CMakeFiles/CppReact.dir/src/logging/EventLog.cpp.o] Error 1
    *** [CMakeFiles/CppReact.dir/src/logging/EventLog.cpp.o] Error 1
    make[1]: *** [CMakeFiles/CppReact.dir/all] Error 2make[1]: *** [CMakeFiles/CppReact.dir/all] Error 2
    

    Btw. compiling with gcc4.9 works with no problems. Any idea how I could get this working with clang?

    opened by 0ax1 1
  • Misleading example in BasicSignals.cpp / Example 4

    Misleading example in BasicSignals.cpp / Example 4

            SignalT<float> Average = Iterate(
                Input,
                0.0f,
                [] (int sample, float oldAvg) {
                    return (oldAvg + sample) / 2.0f;
                });
    

    This does not calculate an average. This code calculates

    Therefore, the code

    Sensor mySensor;
    mySensor.Input << 10 << 5 << 10 << 8;
    cout << "Average: " << mySensor.Average() << endl;
    

    Produces the output

    Example 4 - Creating stateful signals (2)
    Average: 7.75
    

    The average of the values (10, 5, 10, 8) is 8.25, not 7.75.

    opened by klaufir 0
  • Code isn't 64-bit clean in Microsoft compilers

    Code isn't 64-bit clean in Microsoft compilers

    For example, on Visual Studio 2013 Update 2, we see the following (correct) warnings from cl.exe after adding a 64-bit configuration:

    PulsecountEngine.cpp ....\src\engine\PulsecountEngine.cpp(233): warning C4267: 'initializing' : conversion from 'size_t' to 'const react::impl::uint', possible loss of data SubtreeEngine.cpp ....\src\engine\SubtreeEngine.cpp(181): warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data

    This is because ints are 4 bytes on cl.exe 64 -bit code, but size_t is 8 bytes.

    opened by philipcraig 0
  • Is this project dead

    Is this project dead

    This project looks just to what I need for a project, but last update is from 2017, the readme states:

    I'm currently in the process of rewriting the library more or less from scratch and many things are still broken or outdated.

    Apparetly this is not maintaned anymore. :(

    opened by mnesarco 7
  • Support of higher order FRP?

    Support of higher order FRP?

    Could you elaborate which design goals you have when rewriting your library? Are you only planning to support static computation graphs or are you considering higher order of FRP?

    For instance, are you considering implementing operators over Observer<Observer<T>> ? There are many use cases but supporting those are not for free.

    EDIT: Just noticed that the last commit was a year ago. Any (design) specific roadblocks ?

    opened by nikhedonia 0
  • MakeSignal compilation error with Visual Studio 2017 using compiler flag /std:c++17 or /std:c++latest

    MakeSignal compilation error with Visual Studio 2017 using compiler flag /std:c++17 or /std:c++latest

    cpp.react fails to compile on Visual Studio 2017 15.5.7 when attempting to use the C++17 compiler. Specifically, any code that attempts to call MakeSignal() gives build errors.

    For example, building a single file BasicAlgorithms.cpp (using ctrl-F7) gives this error when compiler flag /std::c++17 is enabled in the project properties (under C/C++ --> Language --> C++ Language Standard):

    1>------ Build started: Project: Example_BasicAlgorithms, Configuration: Debug x64 ------ 1>BasicAlgorithms.cpp 1>c:\git\rtvis\3rdparty\intel_tbb\include\tbb\task_group.h(113): error C4996: 'std::uncaught_exception': warning STL4006: std::uncaught_exception() is deprecated in C++17. It is superseded by std::uncaught_exceptions(), plural. You can define _SILENCE_CXX17_UNCAUGHT_EXCEPTION_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to acknowledge that you have received this warning. 1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.12.25827\include\exception(17): note: see declaration of 'std::uncaught_exception' 1>c:\git\cpp.react\include\react\detail\graph\algorithmnodes.h(371): error C2668: 'react::impl::apply': ambiguous call to overloaded function 1>c:\git\cpp.react\include\react\common\util.h(47): note: could be 'void react::impl::apply<react::impl::SyncedIterateByRefNode<D,S,E,react::impl::AddIterateByRefRangeWrapper<E,S,F,int>,int>::Tick::<lambda_fda7c352706d1102d1708ac0ea940db4>,std::tuple<std::shared_ptr>&>(F &&,T)' 1> with 1> [ 1> D=example6::D, 1> S=std::vector<int,std::allocator>, 1> E=int, 1> TNode=react::impl::SignalNodeexample6::D,int, 1> F=react::impl::SyncedIterateByRefNode<example6::D,std::vector<int,std::allocator>,int,react::impl::AddIterateByRefRangeWrapper<int,std::vector<int,std::allocator>,F,int>,int>::Tick::<lambda_fda7c352706d1102d1708ac0ea940db4>, 1> T=std::tuple<std::shared_ptr<react::impl::SignalNodeexample6::D,int>> & 1> ] 1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.12.25827\include\tuple(1043): note: or 'decltype(auto) std::apply<react::impl::SyncedIterateByRefNode<D,S,E,react::impl::AddIterateByRefRangeWrapper<E,S,F,int>,int>::Tick::<lambda_fda7c352706d1102d1708ac0ea940db4>,std::tuple<std::shared_ptr>&>(_Callable &&,_Tuple)' [found using argument-dependent lookup] 1> with 1> [ 1> D=example6::D, 1> S=std::vector<int,std::allocator>, 1> E=int, 1> TNode=react::impl::SignalNodeexample6::D,int, 1> _Callable=react::impl::SyncedIterateByRefNode<example6::D,std::vector<int,std::allocator>,int,react::impl::AddIterateByRefRangeWrapper<int,std::vector<int,std::allocator>,F,int>,int>::Tick::<lambda_fda7c352706d1102d1708ac0ea940db4>, 1> _Tuple=std::tuple<std::shared_ptr<react::impl::SignalNodeexample6::D,int>> & 1> ] 1>c:\git\cpp.react\include\react\detail\graph\algorithmnodes.h(355): note: while trying to match the argument list '(react::impl::SyncedIterateByRefNode<D,S,E,react::impl::AddIterateByRefRangeWrapper<E,S,F,int>,int>::Tick::<lambda_fda7c352706d1102d1708ac0ea940db4>, std::tuple<std::shared_ptr>)' 1> with 1> [ 1> D=example6::D, 1> S=std::vector<int,std::allocator>, 1> E=int 1> ] 1> and 1> [ 1> TNode=react::impl::SignalNodeexample6::D,int 1> ] 1>c:\git\cpp.react\include\react\detail\graph\algorithmnodes.h(355): note: while compiling class template member function 'void react::impl::SyncedIterateByRefNode<D,S,E,react::impl::AddIterateByRefRangeWrapper<E,S,F,int>,int>::Tick(void *)' 1> with 1> [ 1> D=example6::D, 1> S=std::vector<int,std::allocator>, 1> E=int 1> ] 1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.12.25827\include\type_traits(517): note: see reference to class template instantiation 'react::impl::SyncedIterateByRefNode<D,S,E,react::impl::AddIterateByRefRangeWrapper<E,S,F,int>,int>' being compiled 1> with 1> [ 1> D=example6::D, 1> S=std::vector<int,std::allocator>, 1> E=int 1> ] 1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.12.25827\include\memory(1284): note: see reference to class template instantiation 'std::is_convertible<_Yty *,_Ty *>' being compiled 1> with 1> [ 1> _Yty=NodeT, 1> _Ty=react::impl::SignalNode<example6::D,std::vector<int,std::allocator>> 1> ] 1>c:\git\cpp.react\include\react\algorithm.h(145): note: see reference to class template instantiation 'std::_SP_pointer_compatible<NodeT,TNode>' being compiled 1> with 1> [ 1> TNode=react::impl::SignalNode<example6::D,std::vector<int,std::allocator>> 1> ] 1>c:\git\cpp.react\examples\src\basicalgorithms.cpp(285): note: see reference to function template instantiation 'react::Signal<example6::D,std::vector<E,std::allocator<_Ty>>> react::Iterate<D,E,std::vector<_Ty,std::allocator<_Ty>>,example6::Sensor::<lambda_5beba5edb4fefc40f76e4dbbca2548f7>,S,std::vector<_Ty,std::allocator<_Ty>>>(const react::Events<D,E> &,V &&,const react::SignalPack<D,S> &,FIn &&)' being compiled 1> with 1> [ 1> E=int, 1> _Ty=int, 1> D=example6::D, 1> S=int, 1> V=std::vector<int,std::allocator>, 1> FIn=example6::Sensor::<lambda_5beba5edb4fefc40f76e4dbbca2548f7> 1> ] 1>Done building project "Example_BasicAlgorithms.vcxproj" -- FAILED. ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

    Note: this exact same file compiles cleanly when the compiler flag /std:c++14 is used instead:

    1>------ Build started: Project: Example_BasicAlgorithms, Configuration: Debug x64 ------ 1>BasicAlgorithms.cpp ========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

    Do you know how to avoid this "ambiguous call to overloaded function" compiler error in C++17 mode? Any pointers would be greatly appreciated. Thanks!

    opened by scottmcnab 2
  • List of dependencies?

    List of dependencies?

    It seems TBB is a hard dependency? It would be nice to know that on the front-page and/or README.

    Or perhaps I have missed something -- I wanted to use this project on an embedded micro-controller, but I don't think TBB would run there? Just looking to clarify whether it is even possible to use cpp.react without TBB (sequential only?), or if TBB should work on non-Intel platforms?

    opened by paulreimer 0
  • include/react/event.h:106:62: error

    include/react/event.h:106:62: error

    include/react/event.h:106:62: error: storage class specifiers invalid in friend function declarations friend static RET impl::CreateWrappedNode(ARGS&& ... args);

    opened by itfkaps 0
Kokkos C++ Performance Portability Programming EcoSystem: The Programming Model - Parallel Execution and Memory Abstraction

Kokkos: Core Libraries Kokkos Core implements a programming model in C++ for writing performance portable applications targeting all major HPC platfor

Kokkos 1.2k Jan 5, 2023
:copyright: Concurrent Programming Library (Coroutine) for C11

libconcurrent tiny asymmetric-coroutine library. Description asymmetric-coroutine bidirectional communication by yield_value/resume_value native conte

sharow 350 Sep 2, 2022
Header-only library for multithreaded programming

CsLibGuarded Introduction The CsLibGuarded library is a standalone header only library for multithreaded programming. This library provides templated

CopperSpice 188 Jan 2, 2023
Header-only library for multithreaded programming

CsLibGuarded Introduction The CsLibGuarded library is a standalone header only library for multithreaded programming. This library provides templated

CopperSpice 186 Dec 20, 2022
Cpp-taskflow - Modern C++ Parallel Task Programming Library

Cpp-Taskflow A fast C++ header-only library to help you quickly write parallel programs with complex task dependencies Why Cpp-Taskflow? Cpp-Taskflow

null 4 Mar 30, 2021
A General-purpose Parallel and Heterogeneous Task Programming System

Taskflow Taskflow helps you quickly write parallel and heterogeneous tasks programs in modern C++ Why Taskflow? Taskflow is faster, more expressive, a

Taskflow 7.6k Dec 31, 2022
A competitive programming helper tool, which packages included libraries into a single file, suitable for online judges.

cpack Cpack is a competitive programming helper tool, which packages the main source file along with included libraries into a single file, suitable f

PetarMihalj 11 Apr 22, 2022
Material for the UIBK Parallel Programming Lab (2021)

UIBK PS Parallel Systems (703078, 2021) This repository contains material required to complete exercises for the Parallel Programming lab in the 2021

null 12 May 6, 2022
A General-purpose Parallel and Heterogeneous Task Programming System

Taskflow Taskflow helps you quickly write parallel and heterogeneous task programs in modern C++ Why Taskflow? Taskflow is faster, more expressive, an

Taskflow 7.6k Dec 26, 2022
High Performance Linux C++ Network Programming Framework based on IO Multiplexing and Thread Pool

Kingpin is a C++ network programming framework based on TCP/IP + epoll + pthread, aims to implement a library for the high concurrent servers and clie

null 23 Oct 19, 2022
EAThread - EAThread implements a unified cross-platform interface for multithreaded programming.

EAThread EAThread implements a unified cross-platform interface for multithreaded programming on various platforms. Documentation Please see Introduct

Electronic Arts 259 Dec 20, 2022
ParallelComputingPlayground - Shows different programming techniques for parallel computing on CPU and GPU

ParallelComputingPlayground Shows different programming techniques for parallel computing on CPU and GPU. Purpose The idea here is to compute a Mandel

Morten Nobel-Jørgensen 2 May 16, 2020
Awesome-lockfree - A collection of resources on wait-free and lock-free programming

Awesome Lock-Free A collection of resources on wait-free and lock-free programming. ?? ?? ?? Even better resource from MattPD: C++ links: atomics, loc

Erik Rigtorp 1.4k Jan 1, 2023
Bolt is a C++ template library optimized for GPUs. Bolt provides high-performance library implementations for common algorithms such as scan, reduce, transform, and sort.

Bolt is a C++ template library optimized for heterogeneous computing. Bolt is designed to provide high-performance library implementations for common

null 360 Dec 27, 2022
oneAPI DPC++ Library (oneDPL) https://software.intel.com/content/www/us/en/develop/tools/oneapi/components/dpc-library.html

oneAPI DPC++ Library (oneDPL) The oneAPI DPC++ Library (oneDPL) aims to work with the oneAPI DPC++ Compiler to provide high-productivity APIs to devel

oneAPI-SRC 646 Dec 29, 2022
ArrayFire: a general purpose GPU library.

ArrayFire is a general-purpose library that simplifies the process of developing software that targets parallel and massively-parallel architectures i

ArrayFire 4k Dec 27, 2022
A C++ GPU Computing Library for OpenCL

Boost.Compute Boost.Compute is a GPU/parallel-computing library for C++ based on OpenCL. The core library is a thin C++ wrapper over the OpenCL API an

Boost.org 1.4k Jan 5, 2023
A library for enabling task-based multi-threading. It allows execution of task graphs with arbitrary dependencies.

Fiber Tasking Lib This is a library for enabling task-based multi-threading. It allows execution of task graphs with arbitrary dependencies. Dependenc

RichieSams 796 Dec 30, 2022
The C++ Standard Library for Parallelism and Concurrency

Documentation: latest, development (master) HPX HPX is a C++ Standard Library for Concurrency and Parallelism. It implements all of the corresponding

The STE||AR Group 2.1k Jan 3, 2023