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();
Origin
const Origin&
operator()(const Origin& o) const
{
return o;
}
Null_vector
const Null_vector&
operator()(const Null_vector& n) const
{
return n;
}
Bbox_2
const Bbox_2&
operator()(const Bbox_2& b) const
{
return b;
}
Bbox_3
const Bbox_3&
operator()(const Bbox_3& b) const
{
return b;

View File

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