diff --git a/include/boost/gil/algorithm.hpp b/include/boost/gil/algorithm.hpp index e6bf78005e..ee60492300 100644 --- a/include/boost/gil/algorithm.hpp +++ b/include/boost/gil/algorithm.hpp @@ -200,7 +200,7 @@ struct copier_n,O> { while (n>0) { diff_t l=src.width()-src.x_pos(); diff_t numToCopy=(n> { while (n>0) { diff_t l=dst.width()-dst.x_pos(); diff_t numToCopy=(n,iterator_from_2d
    > { while (n>0) { diff_t l=dst.width()-dst.x_pos(); diff_t numToCopy=(n #include #include @@ -110,7 +109,7 @@ class kernel_1d : public detail::kernel_1d_adaptor> kernel_1d(FwdIterator elements, std::size_t size, std::size_t center) : parent_t(size, center) { - detail::copy_n(elements, size, this->begin()); + std::copy_n(elements, size, this->begin()); } kernel_1d(kernel_1d const& other) : parent_t(other) {} @@ -134,7 +133,7 @@ class kernel_1d_fixed : public detail::kernel_1d_adaptor> explicit kernel_1d_fixed(FwdIterator elements, std::size_t center) : parent_t(center) { - detail::copy_n(elements, Size, this->begin()); + std::copy_n(elements, Size, this->begin()); } kernel_1d_fixed(kernel_1d_fixed const& other) : parent_t(other) {} @@ -284,7 +283,7 @@ class kernel_2d : public detail::kernel_2d_adaptor> kernel_2d(FwdIterator elements, std::size_t size, std::size_t center_y, std::size_t center_x) : parent_t(static_cast(std::sqrt(size)), center_y, center_x) { - detail::copy_n(elements, size, this->begin()); + std::copy_n(elements, size, this->begin()); } kernel_2d(kernel_2d const& other) : parent_t(other) {} @@ -318,7 +317,7 @@ class kernel_2d_fixed : : parent_t(center_y, center_x) { this->square_size = Size; - detail::copy_n(elements, Size * Size, this->begin()); + std::copy_n(elements, Size * Size, this->begin()); } kernel_2d_fixed(kernel_2d_fixed const& other) : parent_t(other) {} diff --git a/include/boost/gil/utilities.hpp b/include/boost/gil/utilities.hpp index 5b5926ba04..19ef45999c 100644 --- a/include/boost/gil/utilities.hpp +++ b/include/boost/gil/utilities.hpp @@ -33,7 +33,6 @@ #pragma GCC diagnostic pop #endif -#include #include #include #include @@ -165,45 +164,6 @@ const OutPtr gil_reinterpret_cast_c(const In* p) namespace detail { -//////////////////////////////////////////////////////////////////////////////// -/// \brief copy_n taken from SGI STL. -//////////////////////////////////////////////////////////////////////////////// - -template -std::pair _copy_n(InputIter first, Size count, - OutputIter result, std::input_iterator_tag) -{ - for ( ; count > 0; --count) - { - *result = *first; - ++first; - ++result; - } - return std::pair(first, result); -} - -template -inline std::pair -_copy_n(RAIter first, Size count, OutputIter result, std::random_access_iterator_tag) -{ - RAIter last = first + count; - return std::pair(last, std::copy(first, last, result)); -} - -template -inline std::pair -_copy_n(InputIter first, Size count, OutputIter result) -{ - return _copy_n(first, count, result, typename std::iterator_traits::iterator_category()); -} - -template -inline std::pair -copy_n(InputIter first, Size count, OutputIter result) -{ - return detail::_copy_n(first, count, result); -} - /// \brief identity taken from SGI STL. template struct identity @@ -213,6 +173,7 @@ struct identity const T& operator()(const T& val) const { return val; } }; +// TODO replace with transparent std::plus in C++14 /// \brief plus function object whose arguments may be of different type. template struct plus_asymmetric {