mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-12 09:17:52 -06:00
Fix of compilation on OSX and Linux. By the standard, a temporary
value cannot be passed to a reference.
This commit is contained in:
parent
b292554fd8
commit
9d98a27b98
2 changed files with 7 additions and 9 deletions
|
@ -84,7 +84,7 @@ public:
|
||||||
return end;
|
return end;
|
||||||
}
|
}
|
||||||
template<typename Callback>
|
template<typename Callback>
|
||||||
void parse_line(const std::string &line, Callback &callback)
|
void parse_line(const std::string &line, Callback callback)
|
||||||
{ GCodeLine gline; this->parse_line(line.c_str(), gline, callback); }
|
{ GCodeLine gline; this->parse_line(line.c_str(), gline, callback); }
|
||||||
void parse_file(const std::string &file, callback_t callback);
|
void parse_file(const std::string &file, callback_t callback);
|
||||||
|
|
||||||
|
|
|
@ -156,12 +156,10 @@ namespace Slic3r {
|
||||||
|
|
||||||
void GCodeTimeEstimator::calculate_time_from_lines(const std::vector<std::string>& gcode_lines)
|
void GCodeTimeEstimator::calculate_time_from_lines(const std::vector<std::string>& gcode_lines)
|
||||||
{
|
{
|
||||||
|
auto action = [this](GCodeReader &reader, const GCodeReader::GCodeLine &line)
|
||||||
|
{ this->_process_gcode_line(reader, line); };
|
||||||
for (const std::string& line : gcode_lines)
|
for (const std::string& line : gcode_lines)
|
||||||
{
|
_parser.parse_line(line, action);
|
||||||
_parser.parse_line(line,
|
|
||||||
[this](GCodeReader &reader, const GCodeReader::GCodeLine &line)
|
|
||||||
{ this->_process_gcode_line(reader, line); });
|
|
||||||
}
|
|
||||||
_calculate_time();
|
_calculate_time();
|
||||||
reset();
|
reset();
|
||||||
}
|
}
|
||||||
|
@ -178,11 +176,11 @@ namespace Slic3r {
|
||||||
{
|
{
|
||||||
PROFILE_FUNC();
|
PROFILE_FUNC();
|
||||||
GCodeReader::GCodeLine gline;
|
GCodeReader::GCodeLine gline;
|
||||||
|
auto action = [this](GCodeReader &reader, const GCodeReader::GCodeLine &line)
|
||||||
|
{ this->_process_gcode_line(reader, line); };
|
||||||
for (; *ptr != 0;) {
|
for (; *ptr != 0;) {
|
||||||
gline.reset();
|
gline.reset();
|
||||||
ptr = _parser.parse_line(ptr, gline,
|
ptr = _parser.parse_line(ptr, gline, action);
|
||||||
[this](GCodeReader &reader, const GCodeReader::GCodeLine &line)
|
|
||||||
{ this->_process_gcode_line(reader, line); });
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue