Using a class in another class

Hi

I want to use CPLEX library in c++. The variables of this library can not be defined as poitners (because it does not work so). Therefore, I had to define them statically as follows:

IloEnv env_;
IloModel model_(env_);
...

As class IloModel has not defult constructor, the env_ variable should be passed in the definition.

Now, I want to define class Solver which uses cplex. How can I define env_ and model_ as the members of Solver? If I define them statically as follows:

Class Solver {
IloEnv env_;
IloModel model_(env_);
}

There will be a complie error with defining model_. On the other hand, it is not possible to define Solver as follows and "new" it in the constructor:

Class Solver {
IloEnv env_;
IloModel* model_;
}

Thank you for your help
Topic archived. No new replies allowed.