12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- #ifndef BOOST_UTILITY_SWAP_HPP
- #define BOOST_UTILITY_SWAP_HPP
- #include <algorithm>
- #include <cstddef>
- namespace boost_swap_impl
- {
- template<class T>
- void swap_impl(T& left, T& right)
- {
- using namespace std;
- swap(left,right);
- }
- template<class T, std::size_t N>
- void swap_impl(T (& left)[N], T (& right)[N])
- {
- for (std::size_t i = 0; i < N; ++i)
- {
- ::boost_swap_impl::swap_impl(left[i], right[i]);
- }
- }
- }
- namespace boost
- {
- template<class T1, class T2>
- void swap(T1& left, T2& right)
- {
- ::boost_swap_impl::swap_impl(left, right);
- }
- }
- #endif
|