Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using local dataflow without explicit namespace #774

Closed
mariomulansky opened this issue May 28, 2013 · 2 comments
Closed

Using local dataflow without explicit namespace #774

mariomulansky opened this issue May 28, 2013 · 2 comments

Comments

@mariomulansky
Copy link
Contributor

local dataflows can not be lifted into the current namespace via using hpx::lcos::local::dataflow;. adding this using clause give compile errors, even if dataflows later on are called with the full namespace

#include <iostream>

#include <hpx/hpx.hpp>
#include <hpx/hpx_main.hpp>
#include <hpx/lcos/local/dataflow.hpp>
#include <hpx/util/unwrap.hpp>

// the following line causes compile errors
using hpx::lcos::local::dataflow;

typedef hpx::lcos::future< double > future_type;

template< typename Value >
struct mul 
{
    const Value a;

    mul( const Value alpha ) : a( alpha )
    { }

    double operator() ( double x1 , double x2 ) const // this has to be const?!
    {
        return x1*x2*a;
    }
};

int main()
{
    auto functor = hpx::util::unwrap(mul<double>( 0.5 ));
    future_type f1 = hpx::make_ready_future( 1.0 );
    // compile error even when using full namespace
    future_type f2 = hpx::lcos::local::dataflow( functor , f1 , f1 );
    future_type f3 = hpx::lcos::local::dataflow( hpx::util::unwrap(mul<double>( 2.0 )) , f1 , f1 );

    return 0;
}
@hkaiser
Copy link
Member

hkaiser commented May 30, 2013

I'm not able to reproduce this when using MSVC, is this still a problem?

@mariomulansky
Copy link
Contributor Author

no, with the latest version the problem disappeared.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants