Use some const& to avoid copies

This commit is contained in:
Mael Rouxel-Labbé 2021-11-10 15:40:18 +01:00
parent b26fa9b5ba
commit 57c240980f
2 changed files with 19 additions and 6 deletions

View File

@ -95,25 +95,25 @@ public:
using Base::operator(); using Base::operator();
Origin const Origin&
operator()(const Origin& o) const operator()(const Origin& o) const
{ {
return o; return o;
} }
Null_vector const Null_vector&
operator()(const Null_vector& n) const operator()(const Null_vector& n) const
{ {
return n; return n;
} }
Bbox_2 const Bbox_2&
operator()(const Bbox_2& b) const operator()(const Bbox_2& b) const
{ {
return b; return b;
} }
Bbox_3 const Bbox_3&
operator()(const Bbox_3& b) const operator()(const Bbox_3& b) const
{ {
return b; return b;

View File

@ -28,6 +28,7 @@
#include <CGAL/Enum_converter.h> #include <CGAL/Enum_converter.h>
#include <CGAL/Bbox_2.h> #include <CGAL/Bbox_2.h>
#include <CGAL/Bbox_3.h> #include <CGAL/Bbox_3.h>
#include <CGAL/Origin.h>
namespace CGAL { namespace CGAL {
@ -47,13 +48,25 @@ public:
using Base::operator(); using Base::operator();
Bbox_2 const Origin&
operator()(const Origin& o) const
{
return o;
}
const Null_vector&
operator()(const Null_vector& n) const
{
return n;
}
const Bbox_2&
operator()(const Bbox_2& b) operator()(const Bbox_2& b)
{ {
return b; return b;
} }
Bbox_3 const Bbox_3&
operator()(const Bbox_3& b) operator()(const Bbox_3& b)
{ {
return b; return b;