Q:

g++ issue for passing arguments

Please consider these partial codes:
//Tree.h
class Tree {

private:
    Limits joint_limits;

public:

    Tree();
    Tree(Configuration root, const Limits& _joint_limits);
    ~Tree();
//the rest of the class

second header file:
//RRT.h
class RRT {
private:
    Tree roadmap;

public:
    ~RRT();
    RRT();
    RRT(Configuration _init_conf, Limits _joint_limits);
//the rest of the class

In the RRT constructor, I have this line of code:
RRT::RRT(Configuration _init_conf, Limits _joint_limits) {
    roadmap(init_conf, _joint_limits);
}

When I try to compile it, I have the following error:
no match for call to ‘(Tree) (Configuration&, Limits&)’

Why g++ thinks I'm sending a reference in the RRT constructor and how to solve it? 

A:

You're calling roadmap as if it were a function or declared operator().  To initialise it, you must use the syntax for member initialiser list:
RRT::RRT(Configuration _init_conf, Limits _joint_limits)
    : roadmap(init_conf, _joint_limits);
{
}

A:

In your code you are trying to call a function called roadmap or its operator (). 
Probably it's a mistake. 
You can do this:
RRT::RRT(Configuration _init_conf, Limits _joint_limits) {
    roadmap = Tree(init_conf, _joint_limits);
}

or
RRT::RRT(Configuration _init_conf, Limits _joint_limits)
    : roadmap(init_conf, _joint_limits) {
}

