Capture by reference when the return type is by reference: capture by value when
the return type is by value.
inline void
Timer::print_accumulated_wall_time_data(StreamType &stream) const
{
- const Utilities::MPI::MinMaxAvg statistic = get_accumulated_wall_time_data();
+ const Utilities::MPI::MinMaxAvg &statistic = get_accumulated_wall_time_data();
stream << statistic.max << " wall,"
<< " max @" << statistic.max_index << ", min=" << statistic.min << " @"
<< statistic.min_index << ", avg=" << statistic.avg << std::endl;
boost::archive::binary_oarchive archive(out);
archive << object;
- const std::string &s = out.str();
+ const std::string s = out.str();
dest_buffer.reserve(dest_buffer.size() + s.size());
std::move(s.begin(), s.end(), std::back_inserter(dest_buffer));
}
In the beginning the Universe was created. This has made a lot of
people very angry and has been widely regarded as a bad move.
Douglas Adams