Skip to content

Commit

Permalink
fixes to compile without cxx11
Browse files Browse the repository at this point in the history
1. boost::scoped_ptr can not be returned from a function
2. std::multimap::insert(hint) takes a non-const iterator pre cxx11
  • Loading branch information
tjhei committed Nov 3, 2016
1 parent 5624fe0 commit a6799e7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions source/particle/world.cc
Expand Up @@ -574,7 +574,7 @@ namespace aspect
// particle map.
if (status == parallel::distributed::Triangulation<dim>::CELL_PERSIST)
{
typename std::multimap<types::LevelInd,Particle<dim> >::const_iterator position_hint = particles.end();
typename std::multimap<types::LevelInd,Particle<dim> >::iterator position_hint = particles.end();
for (unsigned int i = 0; i < *n_particles_in_cell_ptr; ++i)
{
// Use std::multimap::emplace_hint to speed up insertion of
Expand Down Expand Up @@ -619,7 +619,7 @@ namespace aspect
}
else if (status == parallel::distributed::Triangulation<dim>::CELL_REFINE)
{
std::vector<typename std::multimap<types::LevelInd, Particle<dim> >::const_iterator > position_hints(GeometryInfo<dim>::max_children_per_cell);
std::vector<typename std::multimap<types::LevelInd, Particle<dim> >::iterator > position_hints(GeometryInfo<dim>::max_children_per_cell);
for (unsigned int child_index=0; child_index<GeometryInfo<dim>::max_children_per_cell; ++child_index)
{
const typename parallel::distributed::Triangulation<dim>::cell_iterator child = cell->child(child_index);
Expand Down
8 changes: 4 additions & 4 deletions source/simulator/core.cc
Expand Up @@ -113,15 +113,15 @@ namespace aspect
* computation.
*/
template <int dim>
std_cxx11::unique_ptr<Mapping<dim> > construct_mapping(const GeometryModel::Interface<dim> &geometry_model,
Mapping<dim>* construct_mapping(const GeometryModel::Interface<dim> &geometry_model,
const InitialTopographyModel::Interface<dim> &initial_topography_model)
{
if (geometry_model.has_curved_elements())
return std_cxx11::unique_ptr<Mapping<dim> >(new MappingQ<dim>(4, true));
return new MappingQ<dim>(4, true);
if (dynamic_cast<const InitialTopographyModel::ZeroTopography<dim>*>(&initial_topography_model) != 0)
return std_cxx11::unique_ptr<Mapping<dim> >(new MappingCartesian<dim>());
return new MappingCartesian<dim>();

return std_cxx11::unique_ptr<Mapping<dim> >(new MappingQ1<dim>());
return new MappingQ1<dim>();
}
}

Expand Down

0 comments on commit a6799e7

Please sign in to comment.