Replace std::ignore with boost::ignore_unused()

According to https://isocpp.org/blog/2016/09/quick-q-stdignore-for-ignoring-unused-variable std::ignore is not supposed to be used for this
This commit is contained in:
wmayer
2022-07-15 13:15:47 +02:00
parent 1e2b7e5a2b
commit a8ac45b090
8 changed files with 16 additions and 6 deletions

View File

@@ -22,6 +22,9 @@
#include "PreCompiled.h"
#ifndef _PreComp_
#include <boost/core/ignore_unused.hpp>
#endif
#include <Base/Exception.h>
#include <Base/Unit.h>
@@ -140,10 +143,10 @@ DocumentObjectExecReturn *FeatureTest::execute()
Enumeration enumObj4("Single item");
enumObj4.setEnums(enums);
std::ignore = enumObj4 == enumObj2;
boost::ignore_unused(enumObj4 == enumObj2);
enumObj4.setEnums(nullptr);
enumObj4 = enumObj2;
std::ignore = enumObj4 == enumObj4.getCStr();
boost::ignore_unused(enumObj4 == enumObj4.getCStr());
Enumeration enumObj5(enums, enums[3]);
enumObj5.isValue(enums[2]);

View File

@@ -25,6 +25,7 @@
#ifndef _PreComp_
# include <memory>
# include <sstream>
# include <boost/core/ignore_unused.hpp>
#endif
#include "Metadata.h"
@@ -61,7 +62,7 @@ namespace MetadataInternal {
void warning(const SAXParseException& toCatch)
{
// Don't deal with warnings at all
std::ignore = toCatch;
boost::ignore_unused(toCatch);
}
void error(const SAXParseException& toCatch)

View File

@@ -88,6 +88,7 @@
// Boost
#include <boost_signals2.hpp>
#include <boost/bind/bind.hpp>
#include <boost/core/ignore_unused.hpp>
#include <boost/regex.hpp>
#include <boost/utility.hpp>

View File

@@ -84,6 +84,7 @@
#include <boost_signals2.hpp>
#include <boost/algorithm/string/predicate.hpp>
#include <boost/bind/bind.hpp>
#include <boost/core/ignore_unused.hpp>
#include <boost/filesystem/exception.hpp>
#include <boost/filesystem/path.hpp>
#include <boost/filesystem/operations.hpp>

View File

@@ -23,6 +23,7 @@
#include "PreCompiled.h"
#ifndef _PreComp_
# include <boost/core/ignore_unused.hpp>
# include <Inventor/actions/SoGetBoundingBoxAction.h>
# include <Inventor/actions/SoGLRenderAction.h>
# include <Inventor/events/SoMouseButtonEvent.h>
@@ -221,7 +222,7 @@ SoFCColorBarBase* SoFCColorBar::getActiveBar() const
void SoFCColorBar::setViewportSize( const SbVec2s& size )
{
std::ignore = size;
boost::ignore_unused(size);
}
void SoFCColorBar::setRange( float fMin, float fMax, int prec )

View File

@@ -162,6 +162,7 @@
#endif // _PreComp_
#include <boost/algorithm/string/predicate.hpp>
#include <boost/core/ignore_unused.hpp>
#include <App/Material.h>
#include <Base/BoundBox.h>
@@ -4280,7 +4281,7 @@ TopoShape &TopoShape::makeTransform(const TopoShape &shape, const gp_Trsf &trsf,
TopoShape &TopoShape::makeGTransform(const TopoShape &shape, const Base::Matrix4D &rclTrf, const char *op, bool copy)
{
std::ignore = op;
boost::ignore_unused(op);
_Shape = shape.transformGShape(rclTrf, copy);
return *this;
}

View File

@@ -42,6 +42,7 @@
// Boost
#include <boost/bind/bind.hpp>
#include <boost/core/ignore_unused.hpp>
// OCC
#include <Standard_math.hxx>

View File

@@ -24,6 +24,7 @@
#include "PreCompiled.h"
#ifndef _PreComp_
# include <boost/core/ignore_unused.hpp>
# include <QAction>
# include <QMessageBox>
#endif
@@ -61,7 +62,7 @@ TaskShapeBinder::TaskShapeBinder(ViewProviderShapeBinder* view, bool newObj, QWi
, ui(new Ui_TaskShapeBinder)
, vp(view)
{
std::ignore = newObj;
boost::ignore_unused(newObj);
// we need a separate container widget to add all controls to
proxy = new QWidget(this);