Skip to content

Fail to compile the example from README.rst  #18

@xsswang

Description

@xsswang

When put the example into a cpp file, then compiles using "clang++ -I.. -Wall -O2 -std=c++11 test1.cpp -o test1 -larmadillo", it gives:

test1.cpp:59:11: error: no matching constructor for initialization of 'cppbugs::MCModel'
MCModel m(model);
^ ~~~~~
../cppbugs/mcmc.model.hpp:38:9: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from
'std::function<void ()>' to 'const cppbugs::MCModel' for 1st argument
class MCModel {
^
../cppbugs/mcmc.model.hpp:55:5: note: candidate constructor not viable: no known conversion from 'std::function<void ()>' to 'cppbugs::RngBase &'
for 1st argument
MCModel(RngBase& rng): rng_(rng), accepted_(0), rejected_(0), logp_value_(-std::numeric_limits::infinity()), old_logp_value_(-s...
^
1 error generated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions