I have the following template structure:
template <typename scalar_type>
struct postc_params{
scalar_type delta;
unsigned int time_horizon;
matrix_math::matrix<scalar_type> dynamics;
boost::shared_ptr<continuous_set> invariant_set_ptr;
boost::shared_ptr<continuous_set> input_set_ptr;
boost::shared_ptr<continuous_set> initial_set_ptr;
};
Now I have a template template with a private member of the specified structure type
template <typename scalar_type>
class A{
....
private:
....
postc_params<scalar_type> my_postc;
};
Inside the definition of a member function of class A, I have the following line of code:
my_postc.initial_set_ptr = my_postc.initial_set_ptr->transform(some_obj);
The conversion function returns a type pointer
boost::shared_ptr<continuous_set>
With this code, I have the following error:
passing 'const boost :: shared_ptr' as the argument 'this' to the argument' boost :: shared_ptr <> & amp; raise :: shared_ptr <> :: operator = (const boost :: shared_ptr &) [with Y = const continuous :: continuous_set, T = continuous :: continuous_set] 'discards qualifiers
Can anyone help me with this?
source
share