Skip to content

Commit 3d14128

Browse files
committed
Merge pull request opencv#12000 from tomoaki0705:fixVS2013noexcept
2 parents 4560909 + 9df7517 commit 3d14128

File tree

2 files changed

+29
-20
lines changed

2 files changed

+29
-20
lines changed

modules/core/include/opencv2/core/cvdef.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,15 @@ Cv64suf;
450450
# define CV_FINAL final
451451
#endif
452452

453+
#ifndef CV_NOEXCEPT
454+
# if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1900/*MSVS 2015*/)
455+
# define CV_NOEXCEPT noexcept
456+
# endif
457+
#endif
458+
#ifndef CV_NOEXCEPT
459+
# define CV_NOEXCEPT
460+
#endif
461+
453462

454463
// Integer types portatibility
455464
#ifdef OPENCV_STDINT_HEADER

modules/core/include/opencv2/core/types.hpp

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -163,12 +163,12 @@ template<typename _Tp> class Point_
163163
Point_();
164164
Point_(_Tp _x, _Tp _y);
165165
Point_(const Point_& pt);
166-
Point_(Point_&& pt) noexcept;
166+
Point_(Point_&& pt) CV_NOEXCEPT;
167167
Point_(const Size_<_Tp>& sz);
168168
Point_(const Vec<_Tp, 2>& v);
169169

170170
Point_& operator = (const Point_& pt);
171-
Point_& operator = (Point_&& pt) noexcept;
171+
Point_& operator = (Point_&& pt) CV_NOEXCEPT;
172172
//! conversion to another data type
173173
template<typename _Tp2> operator Point_<_Tp2>() const;
174174

@@ -245,12 +245,12 @@ template<typename _Tp> class Point3_
245245
Point3_();
246246
Point3_(_Tp _x, _Tp _y, _Tp _z);
247247
Point3_(const Point3_& pt);
248-
Point3_(Point3_&& pt) noexcept;
248+
Point3_(Point3_&& pt) CV_NOEXCEPT;
249249
explicit Point3_(const Point_<_Tp>& pt);
250250
Point3_(const Vec<_Tp, 3>& v);
251251

252252
Point3_& operator = (const Point3_& pt);
253-
Point3_& operator = (Point3_&& pt) noexcept;
253+
Point3_& operator = (Point3_&& pt) CV_NOEXCEPT;
254254
//! conversion to another data type
255255
template<typename _Tp2> operator Point3_<_Tp2>() const;
256256
//! conversion to cv::Vec<>
@@ -321,11 +321,11 @@ template<typename _Tp> class Size_
321321
Size_();
322322
Size_(_Tp _width, _Tp _height);
323323
Size_(const Size_& sz);
324-
Size_(Size_&& sz) noexcept;
324+
Size_(Size_&& sz) CV_NOEXCEPT;
325325
Size_(const Point_<_Tp>& pt);
326326

327327
Size_& operator = (const Size_& sz);
328-
Size_& operator = (Size_&& sz) noexcept;
328+
Size_& operator = (Size_&& sz) CV_NOEXCEPT;
329329
//! the area (width*height)
330330
_Tp area() const;
331331
//! aspect ratio (width/height)
@@ -426,12 +426,12 @@ template<typename _Tp> class Rect_
426426
Rect_();
427427
Rect_(_Tp _x, _Tp _y, _Tp _width, _Tp _height);
428428
Rect_(const Rect_& r);
429-
Rect_(Rect_&& r) noexcept;
429+
Rect_(Rect_&& r) CV_NOEXCEPT;
430430
Rect_(const Point_<_Tp>& org, const Size_<_Tp>& sz);
431431
Rect_(const Point_<_Tp>& pt1, const Point_<_Tp>& pt2);
432432

433433
Rect_& operator = ( const Rect_& r );
434-
Rect_& operator = ( Rect_&& r ) noexcept;
434+
Rect_& operator = ( Rect_&& r ) CV_NOEXCEPT;
435435
//! the top-left corner
436436
Point_<_Tp> tl() const;
437437
//! the bottom-right corner
@@ -642,10 +642,10 @@ template<typename _Tp> class Scalar_ : public Vec<_Tp, 4>
642642
Scalar_(_Tp v0);
643643

644644
Scalar_(const Scalar_& s);
645-
Scalar_(Scalar_&& s) noexcept;
645+
Scalar_(Scalar_&& s) CV_NOEXCEPT;
646646

647647
Scalar_& operator=(const Scalar_& s);
648-
Scalar_& operator=(Scalar_&& s) noexcept;
648+
Scalar_& operator=(Scalar_&& s) CV_NOEXCEPT;
649649

650650
template<typename _Tp2, int cn>
651651
Scalar_(const Vec<_Tp2, cn>& v);
@@ -1162,7 +1162,7 @@ Point_<_Tp>::Point_(const Point_& pt)
11621162
: x(pt.x), y(pt.y) {}
11631163

11641164
template<typename _Tp> inline
1165-
Point_<_Tp>::Point_(Point_&& pt) noexcept
1165+
Point_<_Tp>::Point_(Point_&& pt) CV_NOEXCEPT
11661166
: x(std::move(pt.x)), y(std::move(pt.y)) {}
11671167

11681168
template<typename _Tp> inline
@@ -1181,7 +1181,7 @@ Point_<_Tp>& Point_<_Tp>::operator = (const Point_& pt)
11811181
}
11821182

11831183
template<typename _Tp> inline
1184-
Point_<_Tp>& Point_<_Tp>::operator = (Point_&& pt) noexcept
1184+
Point_<_Tp>& Point_<_Tp>::operator = (Point_&& pt) CV_NOEXCEPT
11851185
{
11861186
x = std::move(pt.x); y = std::move(pt.y);
11871187
return *this;
@@ -1429,7 +1429,7 @@ Point3_<_Tp>::Point3_(const Point3_& pt)
14291429
: x(pt.x), y(pt.y), z(pt.z) {}
14301430

14311431
template<typename _Tp> inline
1432-
Point3_<_Tp>::Point3_(Point3_&& pt) noexcept
1432+
Point3_<_Tp>::Point3_(Point3_&& pt) CV_NOEXCEPT
14331433
: x(std::move(pt.x)), y(std::move(pt.y)), z(std::move(pt.z)) {}
14341434

14351435
template<typename _Tp> inline
@@ -1460,7 +1460,7 @@ Point3_<_Tp>& Point3_<_Tp>::operator = (const Point3_& pt)
14601460
}
14611461

14621462
template<typename _Tp> inline
1463-
Point3_<_Tp>& Point3_<_Tp>::operator = (Point3_&& pt) noexcept
1463+
Point3_<_Tp>& Point3_<_Tp>::operator = (Point3_&& pt) CV_NOEXCEPT
14641464
{
14651465
x = std::move(pt.x); y = std::move(pt.y); z = std::move(pt.z);
14661466
return *this;
@@ -1683,7 +1683,7 @@ Size_<_Tp>::Size_(const Size_& sz)
16831683
: width(sz.width), height(sz.height) {}
16841684

16851685
template<typename _Tp> inline
1686-
Size_<_Tp>::Size_(Size_&& sz) noexcept
1686+
Size_<_Tp>::Size_(Size_&& sz) CV_NOEXCEPT
16871687
: width(std::move(sz.width)), height(std::move(sz.height)) {}
16881688

16891689
template<typename _Tp> inline
@@ -1704,7 +1704,7 @@ Size_<_Tp>& Size_<_Tp>::operator = (const Size_<_Tp>& sz)
17041704
}
17051705

17061706
template<typename _Tp> inline
1707-
Size_<_Tp>& Size_<_Tp>::operator = (Size_<_Tp>&& sz) noexcept
1707+
Size_<_Tp>& Size_<_Tp>::operator = (Size_<_Tp>&& sz) CV_NOEXCEPT
17081708
{
17091709
width = std::move(sz.width); height = std::move(sz.height);
17101710
return *this;
@@ -1825,7 +1825,7 @@ Rect_<_Tp>::Rect_(const Rect_<_Tp>& r)
18251825
: x(r.x), y(r.y), width(r.width), height(r.height) {}
18261826

18271827
template<typename _Tp> inline
1828-
Rect_<_Tp>::Rect_(Rect_<_Tp>&& r) noexcept
1828+
Rect_<_Tp>::Rect_(Rect_<_Tp>&& r) CV_NOEXCEPT
18291829
: x(std::move(r.x)), y(std::move(r.y)), width(std::move(r.width)), height(std::move(r.height)) {}
18301830

18311831
template<typename _Tp> inline
@@ -1852,7 +1852,7 @@ Rect_<_Tp>& Rect_<_Tp>::operator = ( const Rect_<_Tp>& r )
18521852
}
18531853

18541854
template<typename _Tp> inline
1855-
Rect_<_Tp>& Rect_<_Tp>::operator = ( Rect_<_Tp>&& r ) noexcept
1855+
Rect_<_Tp>& Rect_<_Tp>::operator = ( Rect_<_Tp>&& r ) CV_NOEXCEPT
18561856
{
18571857
x = std::move(r.x);
18581858
y = std::move(r.y);
@@ -2149,7 +2149,7 @@ Scalar_<_Tp>::Scalar_(const Scalar_<_Tp>& s) : Vec<_Tp, 4>(s) {
21492149
}
21502150

21512151
template<typename _Tp> inline
2152-
Scalar_<_Tp>::Scalar_(Scalar_<_Tp>&& s) noexcept {
2152+
Scalar_<_Tp>::Scalar_(Scalar_<_Tp>&& s) CV_NOEXCEPT {
21532153
this->val[0] = std::move(s.val[0]);
21542154
this->val[1] = std::move(s.val[1]);
21552155
this->val[2] = std::move(s.val[2]);
@@ -2166,7 +2166,7 @@ Scalar_<_Tp>& Scalar_<_Tp>::operator=(const Scalar_<_Tp>& s) {
21662166
}
21672167

21682168
template<typename _Tp> inline
2169-
Scalar_<_Tp>& Scalar_<_Tp>::operator=(Scalar_<_Tp>&& s) noexcept {
2169+
Scalar_<_Tp>& Scalar_<_Tp>::operator=(Scalar_<_Tp>&& s) CV_NOEXCEPT {
21702170
this->val[0] = std::move(s.val[0]);
21712171
this->val[1] = std::move(s.val[1]);
21722172
this->val[2] = std::move(s.val[2]);

0 commit comments

Comments
 (0)