Commit 928bfe0b authored by Alexander Alekhin's avatar Alexander Alekhin Committed by GitHub

Merge pull request #9088 from sovrasov:no_nostl

core: get rid of OPENCV_NOSTL definition
parents 86e8a105 2a2a1dc5
...@@ -53,12 +53,9 @@ ...@@ -53,12 +53,9 @@
#include <cstring> #include <cstring>
#include <cctype> #include <cctype>
#ifndef OPENCV_NOSTL #include <string>
# include <string>
#endif
// import useful primitives from stl // import useful primitives from stl
#ifndef OPENCV_NOSTL_TRANSITIONAL
# include <algorithm> # include <algorithm>
# include <utility> # include <utility>
# include <cstdlib> //for abs(int) # include <cstdlib> //for abs(int)
...@@ -81,21 +78,6 @@ namespace cv ...@@ -81,21 +78,6 @@ namespace cv
using std::log; using std::log;
} }
#else
namespace cv
{
template<typename T> static inline T min(T a, T b) { return a < b ? a : b; }
template<typename T> static inline T max(T a, T b) { return a > b ? a : b; }
template<typename T> static inline T abs(T a) { return a < 0 ? -a : a; }
template<typename T> static inline void swap(T& a, T& b) { T tmp = a; a = b; b = tmp; }
template<> inline uchar abs(uchar a) { return a; }
template<> inline ushort abs(ushort a) { return a; }
template<> inline unsigned abs(unsigned a) { return a; }
template<> inline uint64 abs(uint64 a) { return a; }
}
#endif
namespace cv { namespace cv {
//! @addtogroup core_utils //! @addtogroup core_utils
...@@ -555,7 +537,6 @@ public: ...@@ -555,7 +537,6 @@ public:
String toLowerCase() const; String toLowerCase() const;
#ifndef OPENCV_NOSTL
String(const std::string& str); String(const std::string& str);
String(const std::string& str, size_t pos, size_t len = npos); String(const std::string& str, size_t pos, size_t len = npos);
String& operator=(const std::string& str); String& operator=(const std::string& str);
...@@ -564,7 +545,6 @@ public: ...@@ -564,7 +545,6 @@ public:
friend String operator+ (const String& lhs, const std::string& rhs); friend String operator+ (const String& lhs, const std::string& rhs);
friend String operator+ (const std::string& lhs, const String& rhs); friend String operator+ (const std::string& lhs, const String& rhs);
#endif
private: private:
char* cstr_; char* cstr_;
...@@ -1049,21 +1029,10 @@ static inline bool operator>= (const String& lhs, const char* rhs) { return lh ...@@ -1049,21 +1029,10 @@ static inline bool operator>= (const String& lhs, const char* rhs) { return lh
} // cv } // cv
#ifndef OPENCV_NOSTL_TRANSITIONAL
namespace std namespace std
{ {
static inline void swap(cv::String& a, cv::String& b) { a.swap(b); } static inline void swap(cv::String& a, cv::String& b) { a.swap(b); }
} }
#else
namespace cv
{
template<> inline
void swap<cv::String>(cv::String& a, cv::String& b)
{
a.swap(b);
}
}
#endif
#include "opencv2/core/ptr.inl.hpp" #include "opencv2/core/ptr.inl.hpp"
......
...@@ -44,10 +44,8 @@ ...@@ -44,10 +44,8 @@
#ifndef OPENCV_CORE_CVSTDINL_HPP #ifndef OPENCV_CORE_CVSTDINL_HPP
#define OPENCV_CORE_CVSTDINL_HPP #define OPENCV_CORE_CVSTDINL_HPP
#ifndef OPENCV_NOSTL #include <complex>
# include <complex> #include <ostream>
# include <ostream>
#endif
//! @cond IGNORED //! @cond IGNORED
...@@ -58,7 +56,6 @@ ...@@ -58,7 +56,6 @@
namespace cv namespace cv
{ {
#ifndef OPENCV_NOSTL
template<typename _Tp> class DataType< std::complex<_Tp> > template<typename _Tp> class DataType< std::complex<_Tp> >
{ {
...@@ -280,7 +277,6 @@ static inline std::ostream& operator << (std::ostream& out, const MatSize& msize ...@@ -280,7 +277,6 @@ static inline std::ostream& operator << (std::ostream& out, const MatSize& msize
return out; return out;
} }
#endif // OPENCV_NOSTL
} // cv } // cv
#ifdef _MSC_VER #ifdef _MSC_VER
......
...@@ -2969,9 +2969,7 @@ public: ...@@ -2969,9 +2969,7 @@ public:
typedef const uchar** pointer; typedef const uchar** pointer;
typedef uchar* reference; typedef uchar* reference;
#ifndef OPENCV_NOSTL
typedef std::random_access_iterator_tag iterator_category; typedef std::random_access_iterator_tag iterator_category;
#endif
//! default constructor //! default constructor
MatConstIterator(); MatConstIterator();
...@@ -3036,9 +3034,7 @@ public: ...@@ -3036,9 +3034,7 @@ public:
typedef const _Tp* pointer; typedef const _Tp* pointer;
typedef const _Tp& reference; typedef const _Tp& reference;
#ifndef OPENCV_NOSTL
typedef std::random_access_iterator_tag iterator_category; typedef std::random_access_iterator_tag iterator_category;
#endif
//! default constructor //! default constructor
MatConstIterator_(); MatConstIterator_();
...@@ -3089,9 +3085,7 @@ public: ...@@ -3089,9 +3085,7 @@ public:
typedef _Tp* pointer; typedef _Tp* pointer;
typedef _Tp& reference; typedef _Tp& reference;
#ifndef OPENCV_NOSTL
typedef std::random_access_iterator_tag iterator_category; typedef std::random_access_iterator_tag iterator_category;
#endif
//! the default constructor //! the default constructor
MatIterator_(); MatIterator_();
...@@ -3225,9 +3219,7 @@ template<typename _Tp> class SparseMatConstIterator_ : public SparseMatConstIter ...@@ -3225,9 +3219,7 @@ template<typename _Tp> class SparseMatConstIterator_ : public SparseMatConstIter
{ {
public: public:
#ifndef OPENCV_NOSTL
typedef std::forward_iterator_tag iterator_category; typedef std::forward_iterator_tag iterator_category;
#endif
//! the default constructor //! the default constructor
SparseMatConstIterator_(); SparseMatConstIterator_();
...@@ -3261,9 +3253,7 @@ template<typename _Tp> class SparseMatIterator_ : public SparseMatConstIterator_ ...@@ -3261,9 +3253,7 @@ template<typename _Tp> class SparseMatIterator_ : public SparseMatConstIterator_
{ {
public: public:
#ifndef OPENCV_NOSTL
typedef std::forward_iterator_tag iterator_category; typedef std::forward_iterator_tag iterator_category;
#endif
//! the default constructor //! the default constructor
SparseMatIterator_(); SparseMatIterator_();
......
...@@ -570,9 +570,7 @@ public: ...@@ -570,9 +570,7 @@ public:
operator double() const; operator double() const;
//! returns the node content as text string //! returns the node content as text string
operator String() const; operator String() const;
#ifndef OPENCV_NOSTL
operator std::string() const; operator std::string() const;
#endif
//! returns pointer to the underlying file node //! returns pointer to the underlying file node
CvFileNode* operator *(); CvFileNode* operator *();
......
...@@ -1022,7 +1022,6 @@ template<typename _Tp, size_t fixed_size> inline ...@@ -1022,7 +1022,6 @@ template<typename _Tp, size_t fixed_size> inline
AutoBuffer<_Tp, fixed_size>::operator const _Tp* () const AutoBuffer<_Tp, fixed_size>::operator const _Tp* () const
{ return ptr; } { return ptr; }
#ifndef OPENCV_NOSTL
template<> inline std::string CommandLineParser::get<std::string>(int index, bool space_delete) const template<> inline std::string CommandLineParser::get<std::string>(int index, bool space_delete) const
{ {
return get<String>(index, space_delete); return get<String>(index, space_delete);
...@@ -1031,7 +1030,6 @@ template<> inline std::string CommandLineParser::get<std::string>(const String& ...@@ -1031,7 +1030,6 @@ template<> inline std::string CommandLineParser::get<std::string>(const String&
{ {
return get<String>(name, space_delete); return get<String>(name, space_delete);
} }
#endif // OPENCV_NOSTL
//! @endcond //! @endcond
......
...@@ -56,21 +56,8 @@ namespace cv{ ...@@ -56,21 +56,8 @@ namespace cv{
double _scale; double _scale;
}; };
#ifndef OPENCV_NOSTL
using std::transform; using std::transform;
#else
template <class InputIterator, class InputIterator2, class OutputIterator, class BinaryOperator>
static OutputIterator transform (InputIterator first1, InputIterator last1, InputIterator2 first2,
OutputIterator result, BinaryOperator binary_op)
{
while (first1 != last1)
{
*result = binary_op(*first1, *first2);
++result; ++first1; ++first2;
}
return result;
}
#endif
void denoise_TVL1(const std::vector<Mat>& observations,Mat& result, double lambda, int niters){ void denoise_TVL1(const std::vector<Mat>& observations,Mat& result, double lambda, int niters){
CV_Assert(observations.size()>0 && niters>0 && lambda>0); CV_Assert(observations.size()>0 && niters>0 && lambda>0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment