Skip to content

Commit

Permalink
Fix warning: defaulted and deleted functions only available with -std…
Browse files Browse the repository at this point in the history
…=c++11 or -std=gnu++11

Warning detected on centos 7.2 ci
  • Loading branch information
fspindle committed Jan 3, 2025
1 parent 03c0fb1 commit e3f1971
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 7 deletions.
12 changes: 9 additions & 3 deletions modules/core/include/visp3/core/vpRGBa.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,13 @@ class VISP_EXPORT vpRGBa
}

/*!
Copy constructor.
*/
* Copy constructor.
*/
#if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
inline vpRGBa(const vpRGBa &v) = default;
#else
inline vpRGBa(const vpRGBa &v) : R(v.R), G(v.G), B(v.B), A(v.A) { }
#endif

/*!
Create a RGBa value from a 4 dimension column vector.
Expand All @@ -148,9 +152,11 @@ class VISP_EXPORT vpRGBa
vpRGBa &operator=(const unsigned char &v);
vpRGBa &operator=(const unsigned int &v);
vpRGBa &operator=(const int &v);
vpRGBa &operator=(const vpRGBa &v) = default;
#if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
vpRGBa &operator=(vpRGBa &&v) = default;
vpRGBa &operator=(const vpRGBa &v) = default;
#else
vpRGBa &operator=(const vpRGBa &v);
#endif
vpRGBa &operator=(const vpColVector &v);
bool operator==(const vpRGBa &v) const;
Expand Down
13 changes: 9 additions & 4 deletions modules/core/include/visp3/core/vpRGBf.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,13 @@ class VISP_EXPORT vpRGBf
}

/*!
Copy constructor.
*/
* Copy constructor.
*/
#if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
inline vpRGBf(const vpRGBf &v) = default;

#else
inline vpRGBf(const vpRGBf &v) : R(v.R), G(v.G), B(v.B) { }
#endif
/*!
Create a RGB value from a 3 dimensional column vector.
Expand All @@ -120,9 +123,11 @@ class VISP_EXPORT vpRGBf

vpRGBf &operator=(float v);
vpRGBf &operator=(int v);
vpRGBf &operator=(const vpRGBf &v) = default;
#if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
vpRGBf &operator=(const vpRGBf &v) = default;
vpRGBf &operator=(vpRGBf &&v) = default;
#else
vpRGBf &operator=(const vpRGBf &v);
#endif
vpRGBf &operator=(const vpColVector &v);
bool operator==(const vpRGBf &v) const;
Expand Down
14 changes: 14 additions & 0 deletions modules/core/src/image/vpRGBa.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,20 @@ vpRGBa &vpRGBa::operator=(const int &v)
return *this;
}

#if (VISP_CXX_STANDARD < VISP_CXX_STANDARD_11)
/*!
* Copy operator.
*/
vpRGBa &vpRGBa::operator=(const vpRGBa &v)
{
this->R = v.R;
this->G = v.G;
this->B = v.B;
this->A = v.A;
return *this;
}
#endif

/*!
Cast a vpColVector in a vpRGBa
Expand Down
13 changes: 13 additions & 0 deletions modules/core/src/image/vpRGBf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,19 @@ vpRGBf &vpRGBf::operator=(int v)
return *this;
}

#if (VISP_CXX_STANDARD < VISP_CXX_STANDARD_11)
/*!
* Copy operator.
*/
vpRGBf &vpRGBf::operator=(const vpRGBf &v)
{
this->R = v.R;
this->G = v.G;
this->B = v.B;
return *this;
}
#endif

/*!
Cast a vpColVector in a vpRGBf
Expand Down

0 comments on commit e3f1971

Please sign in to comment.