variant::which() => variant::index() + typos

This commit is contained in:
Sébastien Loriot 2023-05-04 10:26:16 +02:00
parent 56499e017d
commit edc317d771
7 changed files with 15 additions and 14 deletions

View File

@ -339,7 +339,6 @@ namespace CGAL {
template <class CircularKernel> template <class CircularKernel>
class Variant_Construct_min_vertex_2 class Variant_Construct_min_vertex_2
<const typename CircularKernel::Circular_arc_point_2&>
{ {
typedef typename CircularKernel::Circular_arc_point_2 typedef typename CircularKernel::Circular_arc_point_2
Circular_arc_point_2; Circular_arc_point_2;

View File

@ -459,12 +459,12 @@ private:
Td_map_item item (*this); Td_map_item item (*this);
if (ptr()->rb.which() != 0) if (ptr()->rb.index() != 0)
{ {
Self tr(std::get<Self>(rb())); Self tr(std::get<Self>(rb()));
tr.set_lb(item); tr.set_lb(item);
} }
if (ptr()->rt.which() != 0) if (ptr()->rt.index() != 0)
{ {
Self tr(std::get<Self>(rt())); Self tr(std::get<Self>(rt()));
tr.set_lt(item); tr.set_lt(item);

View File

@ -957,13 +957,13 @@ public:
//returns true if the trapezoid is a curve //returns true if the trapezoid is a curve
bool is_empty_item(const Td_map_item& tr) const bool is_empty_item(const Td_map_item& tr) const
{ {
return (tr.which() == 0); return (tr.index() == 0);
} }
//returns true if the trapezoid is a point or a curve //returns true if the trapezoid is a point or a curve
bool is_trapezoid(const Td_map_item& tr) const bool is_trapezoid(const Td_map_item& tr) const
{ {
switch (tr.which()) switch (tr.index())
{ {
case TD_ACTIVE_TRAPEZOID: case TD_ACTIVE_TRAPEZOID:
case TD_INACTIVE_TRAPEZOID: case TD_INACTIVE_TRAPEZOID:
@ -976,7 +976,7 @@ public:
//returns true if the map item is a vertex //returns true if the map item is a vertex
bool is_td_vertex(const Td_map_item& tr) const bool is_td_vertex(const Td_map_item& tr) const
{ {
switch (tr.which()) switch (tr.index())
{ {
case TD_ACTIVE_VERTEX: case TD_ACTIVE_VERTEX:
case TD_ACTIVE_FICTITIOUS_VERTEX: case TD_ACTIVE_FICTITIOUS_VERTEX:
@ -991,7 +991,7 @@ public:
//returns true if the map item is an edge //returns true if the map item is an edge
bool is_td_edge(const Td_map_item& tr) const bool is_td_edge(const Td_map_item& tr) const
{ {
switch (tr.which()) switch (tr.index())
{ {
case TD_ACTIVE_EDGE: case TD_ACTIVE_EDGE:
case TD_INACTIVE_EDGE: case TD_INACTIVE_EDGE:
@ -1004,7 +1004,7 @@ public:
//returns true if the map item is an edge //returns true if the map item is an edge
bool is_td_trapezoid(const Td_map_item& tr) const bool is_td_trapezoid(const Td_map_item& tr) const
{ {
switch (tr.which()) switch (tr.index())
{ {
case TD_ACTIVE_TRAPEZOID: case TD_ACTIVE_TRAPEZOID:
case TD_INACTIVE_TRAPEZOID: case TD_INACTIVE_TRAPEZOID:
@ -1017,7 +1017,7 @@ public:
//returns true if the trapezoid is a curve //returns true if the trapezoid is a curve
bool is_fictitious_vertex(const Td_map_item& tr) const bool is_fictitious_vertex(const Td_map_item& tr) const
{ {
switch (tr.which()) switch (tr.index())
{ {
case TD_ACTIVE_FICTITIOUS_VERTEX: case TD_ACTIVE_FICTITIOUS_VERTEX:
case TD_INACTIVE_FICTITIOUS_VERTEX: case TD_INACTIVE_FICTITIOUS_VERTEX:
@ -1030,7 +1030,7 @@ public:
//returns true if the trapezoid is a curve //returns true if the trapezoid is a curve
bool is_active(const Td_map_item& tr) const bool is_active(const Td_map_item& tr) const
{ {
switch (tr.which()) switch (tr.index())
{ {
case TD_ACTIVE_TRAPEZOID: case TD_ACTIVE_TRAPEZOID:
case TD_ACTIVE_EDGE: case TD_ACTIVE_EDGE:

View File

@ -717,6 +717,7 @@ public:
/*! A visitor to set the cw halfedge of a vertex node. /*! A visitor to set the cw halfedge of a vertex node.
*/ */
class set_cw_he_visitor class set_cw_he_visitor
{
public: public:
set_cw_he_visitor(Halfedge_const_handle he) : m_cw_he(he) {} set_cw_he_visitor(Halfedge_const_handle he) : m_cw_he(he) {}
@ -735,6 +736,7 @@ public:
/*! A visitor to reset the cw halfedge of a vertex node. /*! A visitor to reset the cw halfedge of a vertex node.
*/ */
class reset_cw_he_visitor class reset_cw_he_visitor
{
public: public:
void operator()(Td_active_vertex& t) const { t.reset_cw_he(); } void operator()(Td_active_vertex& t) const { t.reset_cw_he(); }

View File

@ -23,7 +23,7 @@ namespace CGAL {
class Hyperbolic_data class Hyperbolic_data
{ {
typedef boost::int8_t Id; typedef std::int8_t Id;
private: private:
// - 2 for infinite face // - 2 for infinite face

View File

@ -314,7 +314,7 @@ void output_to_vtu_with_attributes(std::ostream& os,
os << " <CellData Scalars=\""<<attributes.front().first<<"\">\n"; os << " <CellData Scalars=\""<<attributes.front().first<<"\">\n";
for(std::size_t i = 0; i< attributes.size(); ++i) for(std::size_t i = 0; i< attributes.size(); ++i)
{ {
switch(attributes[i].second.which()){ switch(attributes[i].second.index()){
case 0: case 0:
write_attribute_tag(os,attributes[i].first, *std::get<const std::vector<double>* >(attributes[i].second), binary,offset); write_attribute_tag(os,attributes[i].first, *std::get<const std::vector<double>* >(attributes[i].second), binary,offset);
break; break;
@ -334,7 +334,7 @@ void output_to_vtu_with_attributes(std::ostream& os,
write_c3t3_points(os,tr,V); // fills V if the mode is BINARY write_c3t3_points(os,tr,V); // fills V if the mode is BINARY
write_cells(os,c3t3,V); write_cells(os,c3t3,V);
for(std::size_t i = 0; i< attributes.size(); ++i) for(std::size_t i = 0; i< attributes.size(); ++i)
switch(attributes[i].second.which()){ switch(attributes[i].second.index()){
case 0: case 0:
write_attributes(os, *std::get<const std::vector<double>* >(attributes[i].second)); write_attributes(os, *std::get<const std::vector<double>* >(attributes[i].second));
break; break;

View File

@ -61,7 +61,7 @@ class Output_rep<std::variant<int,
public: public:
Output_rep(const Variant& v) : v(v) {} Output_rep(const Variant& v) : v(v) {}
std::ostream& operator()( std::ostream& out) const { std::ostream& operator()( std::ostream& out) const {
if(v.which() == 1) { if(v.index() == 1) {
out << IO::oformat(std::get<std::pair<int, int> >(v)); out << IO::oformat(std::get<std::pair<int, int> >(v));
} else { } else {
out << std::get<int>(v); out << std::get<int>(v);