Skip to content

Commit 2a2a1dc

Browse files
committed
Get rid of OPENCV_NOSTL definition
1 parent 7b8e630 commit 2a2a1dc

File tree

6 files changed

+4
-66
lines changed

6 files changed

+4
-66
lines changed

modules/core/include/opencv2/core/cvstd.hpp

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,9 @@
5353
#include <cstring>
5454
#include <cctype>
5555

56-
#ifndef OPENCV_NOSTL
57-
# include <string>
58-
#endif
56+
#include <string>
5957

6058
// import useful primitives from stl
61-
#ifndef OPENCV_NOSTL_TRANSITIONAL
6259
# include <algorithm>
6360
# include <utility>
6461
# include <cstdlib> //for abs(int)
@@ -81,21 +78,6 @@ namespace cv
8178
using std::log;
8279
}
8380

84-
#else
85-
namespace cv
86-
{
87-
template<typename T> static inline T min(T a, T b) { return a < b ? a : b; }
88-
template<typename T> static inline T max(T a, T b) { return a > b ? a : b; }
89-
template<typename T> static inline T abs(T a) { return a < 0 ? -a : a; }
90-
template<typename T> static inline void swap(T& a, T& b) { T tmp = a; a = b; b = tmp; }
91-
92-
template<> inline uchar abs(uchar a) { return a; }
93-
template<> inline ushort abs(ushort a) { return a; }
94-
template<> inline unsigned abs(unsigned a) { return a; }
95-
template<> inline uint64 abs(uint64 a) { return a; }
96-
}
97-
#endif
98-
9981
namespace cv {
10082

10183
//! @addtogroup core_utils
@@ -555,7 +537,6 @@ class CV_EXPORTS String
555537

556538
String toLowerCase() const;
557539

558-
#ifndef OPENCV_NOSTL
559540
String(const std::string& str);
560541
String(const std::string& str, size_t pos, size_t len = npos);
561542
String& operator=(const std::string& str);
@@ -564,7 +545,6 @@ class CV_EXPORTS String
564545

565546
friend String operator+ (const String& lhs, const std::string& rhs);
566547
friend String operator+ (const std::string& lhs, const String& rhs);
567-
#endif
568548

569549
private:
570550
char* cstr_;
@@ -1049,21 +1029,10 @@ static inline bool operator>= (const String& lhs, const char* rhs) { return lh
10491029

10501030
} // cv
10511031

1052-
#ifndef OPENCV_NOSTL_TRANSITIONAL
10531032
namespace std
10541033
{
10551034
static inline void swap(cv::String& a, cv::String& b) { a.swap(b); }
10561035
}
1057-
#else
1058-
namespace cv
1059-
{
1060-
template<> inline
1061-
void swap<cv::String>(cv::String& a, cv::String& b)
1062-
{
1063-
a.swap(b);
1064-
}
1065-
}
1066-
#endif
10671036

10681037
#include "opencv2/core/ptr.inl.hpp"
10691038

modules/core/include/opencv2/core/cvstd.inl.hpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,8 @@
4444
#ifndef OPENCV_CORE_CVSTDINL_HPP
4545
#define OPENCV_CORE_CVSTDINL_HPP
4646

47-
#ifndef OPENCV_NOSTL
48-
# include <complex>
49-
# include <ostream>
50-
#endif
47+
#include <complex>
48+
#include <ostream>
5149

5250
//! @cond IGNORED
5351

@@ -58,7 +56,6 @@
5856

5957
namespace cv
6058
{
61-
#ifndef OPENCV_NOSTL
6259

6360
template<typename _Tp> class DataType< std::complex<_Tp> >
6461
{
@@ -280,7 +277,6 @@ static inline std::ostream& operator << (std::ostream& out, const MatSize& msize
280277
return out;
281278
}
282279

283-
#endif // OPENCV_NOSTL
284280
} // cv
285281

286282
#ifdef _MSC_VER

modules/core/include/opencv2/core/mat.hpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2967,9 +2967,7 @@ class CV_EXPORTS MatConstIterator
29672967
typedef const uchar** pointer;
29682968
typedef uchar* reference;
29692969

2970-
#ifndef OPENCV_NOSTL
29712970
typedef std::random_access_iterator_tag iterator_category;
2972-
#endif
29732971

29742972
//! default constructor
29752973
MatConstIterator();
@@ -3034,9 +3032,7 @@ class MatConstIterator_ : public MatConstIterator
30343032
typedef const _Tp* pointer;
30353033
typedef const _Tp& reference;
30363034

3037-
#ifndef OPENCV_NOSTL
30383035
typedef std::random_access_iterator_tag iterator_category;
3039-
#endif
30403036

30413037
//! default constructor
30423038
MatConstIterator_();
@@ -3087,9 +3083,7 @@ class MatIterator_ : public MatConstIterator_<_Tp>
30873083
typedef _Tp* pointer;
30883084
typedef _Tp& reference;
30893085

3090-
#ifndef OPENCV_NOSTL
30913086
typedef std::random_access_iterator_tag iterator_category;
3092-
#endif
30933087

30943088
//! the default constructor
30953089
MatIterator_();
@@ -3223,9 +3217,7 @@ template<typename _Tp> class SparseMatConstIterator_ : public SparseMatConstIter
32233217
{
32243218
public:
32253219

3226-
#ifndef OPENCV_NOSTL
32273220
typedef std::forward_iterator_tag iterator_category;
3228-
#endif
32293221

32303222
//! the default constructor
32313223
SparseMatConstIterator_();
@@ -3259,9 +3251,7 @@ template<typename _Tp> class SparseMatIterator_ : public SparseMatConstIterator_
32593251
{
32603252
public:
32613253

3262-
#ifndef OPENCV_NOSTL
32633254
typedef std::forward_iterator_tag iterator_category;
3264-
#endif
32653255

32663256
//! the default constructor
32673257
SparseMatIterator_();

modules/core/include/opencv2/core/persistence.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -570,9 +570,7 @@ class CV_EXPORTS_W_SIMPLE FileNode
570570
operator double() const;
571571
//! returns the node content as text string
572572
operator String() const;
573-
#ifndef OPENCV_NOSTL
574573
operator std::string() const;
575-
#endif
576574

577575
//! returns pointer to the underlying file node
578576
CvFileNode* operator *();

modules/core/include/opencv2/core/utility.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1022,7 +1022,6 @@ template<typename _Tp, size_t fixed_size> inline
10221022
AutoBuffer<_Tp, fixed_size>::operator const _Tp* () const
10231023
{ return ptr; }
10241024

1025-
#ifndef OPENCV_NOSTL
10261025
template<> inline std::string CommandLineParser::get<std::string>(int index, bool space_delete) const
10271026
{
10281027
return get<String>(index, space_delete);
@@ -1031,7 +1030,6 @@ template<> inline std::string CommandLineParser::get<std::string>(const String&
10311030
{
10321031
return get<String>(name, space_delete);
10331032
}
1034-
#endif // OPENCV_NOSTL
10351033

10361034
//! @endcond
10371035

modules/photo/src/denoise_tvl1.cpp

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -56,21 +56,8 @@ namespace cv{
5656
double _scale;
5757
};
5858

59-
#ifndef OPENCV_NOSTL
6059
using std::transform;
61-
#else
62-
template <class InputIterator, class InputIterator2, class OutputIterator, class BinaryOperator>
63-
static OutputIterator transform (InputIterator first1, InputIterator last1, InputIterator2 first2,
64-
OutputIterator result, BinaryOperator binary_op)
65-
{
66-
while (first1 != last1)
67-
{
68-
*result = binary_op(*first1, *first2);
69-
++result; ++first1; ++first2;
70-
}
71-
return result;
72-
}
73-
#endif
60+
7461
void denoise_TVL1(const std::vector<Mat>& observations,Mat& result, double lambda, int niters){
7562

7663
CV_Assert(observations.size()>0 && niters>0 && lambda>0);

0 commit comments

Comments
 (0)