diff --git a/src/mrw/deque.hxx b/src/mrw/deque.hxx index 3c516f5..eec3ef7 100644 --- a/src/mrw/deque.hxx +++ b/src/mrw/deque.hxx @@ -49,21 +49,12 @@ @param o a value to be inserted into deque @c l @pre \#include */ -#ifdef MRW__OLD_PRE11_COMPILER template std::deque operator<<(std::deque l, const T& o) throw(std::bad_exception) { l.push_back(o); return l; } -#else -template - std::deque&& operator<<(std::deque&& l, const T& o) - throw(std::bad_exception) { - l.push_back(o); - return l; -} -#endif /** @brief extract the first value of a deque @@ -83,22 +74,8 @@ template shortened by the shifted element @pre \#include */ -#ifdef MRW__OLD_PRE11_COMPILER -template - std::deque operator>>(std::deque l, T& o) - throw(std::exception) { - typename std::deque::iterator it(l.begin()); - if (it==l.end()) - throw mrw::length_error(std::string(__FILE__ ":")+__LINE__+ - ": std::deque<>& operator>>(std::deque<>&, T&)," - " deque is empty"); - o = *it; - l.erase(it); - return l; -} -#else template - std::deque&& operator>>(std::deque&& l, T& o) + std::deque& operator>>(std::deque& l, T& o) throw(std::exception) { typename std::deque::iterator it(l.begin()); if (it==l.end()) @@ -109,7 +86,6 @@ template l.erase(it); return l; } -#endif //@} //@} diff --git a/src/mrw/list.hxx b/src/mrw/list.hxx index f810197..c9d5f37 100644 --- a/src/mrw/list.hxx +++ b/src/mrw/list.hxx @@ -67,14 +67,8 @@ @param o a value to be inserted into list @c l @pre \#include */ -// template -// std::list& operator<<(std::list& l, const FROM& o) -// throw(std::bad_exception) { -// l.push_back(T(o)); -// return l; -// } template - std::list& operator<<(std::list& l, const T& o) + std::list operator<<(std::list l, const T& o) throw(std::bad_exception) { l.push_back(o); return l; @@ -91,8 +85,8 @@ template @param o a value to be inserted into list @c l @pre \#include */ template - std::list& operator<<(std::list& l, - const char *const o) + std::list operator<<(std::list l, + const char *const o) throw(std::bad_exception) { l.push_back(T(o)); return l; diff --git a/src/mrw/map.hxx b/src/mrw/map.hxx index 8852a4f..872e98a 100644 --- a/src/mrw/map.hxx +++ b/src/mrw/map.hxx @@ -51,7 +51,6 @@ @param o a value to be inserted into map @c l @pre \#include */ -#ifdef MRW__OLD_PRE11_COMPILER template std::map operator<<(std::map l, const std::pair& o) @@ -63,19 +62,6 @@ template "map element already exists"); return l; } -#else -template - std::map&& operator<<(std::map&& l, - const std::pair& o) - throw(std::exception) { - if (!l.insert(o).second) - throw mrw::invalid_argument(std::string(__FILE__ ":")+__LINE__+ - ": std::map<>&" - " operator<<(std::map<>&, const T&)," - "map element already exists"); - return l; -} -#endif /** @brief extract the first value of a map @@ -96,9 +82,9 @@ template shortened by the shifted element @pre \#include */ -#ifdef MRW__OLD_PRE11_COMPILER template - std::map operator>>(std::map l, std::pair& o) + std::map& operator>>(std::map& l, + std::pair& o) throw(std::exception) { typename std::map::iterator it(l.begin()); if (it==l.end()) @@ -109,21 +95,6 @@ template l.erase(it); return l; } -#else -template - std::map&& operator>>(std::map&& l, - std::pair& o) - throw(std::exception) { - typename std::map::iterator it(l.begin()); - if (it==l.end()) - throw mrw::length_error(std::string(__FILE__ ":")+__LINE__+ - ": std::map<>& operator>>(std::map<>&, T&)," - " map is empty"); - o = *it; - l.erase(it); - return l; -} -#endif //@} //@} diff --git a/src/mrw/multimap.hxx b/src/mrw/multimap.hxx index 1359bba..ca39c8a 100644 --- a/src/mrw/multimap.hxx +++ b/src/mrw/multimap.hxx @@ -51,7 +51,6 @@ @param o a value to be inserted into multimap @c l @pre \#include */ -#ifdef MRW__OLD_PRE11_COMPILER template std::multimap operator<<(std::multimap l, const std::pair& o) @@ -59,15 +58,6 @@ template l.insert(o); return l; } -#else -template && - std::multimap operator<<(std::multimap&& l, - const std::pair& o) - throw(std::bad_exception) { - l.insert(o); - return l; -} -#endif /** @brief extract the first value of a multimap @@ -88,9 +78,8 @@ template && shortened by the shifted element @pre \#include */ -#ifdef MRW__OLD_PRE11_COMPILER template - std::multimap operator>>(std::multimap l, + std::multimap& operator>>(std::multimap& l, std::pair& o) throw(std::exception) { typename std::multimap::iterator it(l.begin()); @@ -102,21 +91,6 @@ template l.erase(it); return l; } -#else -template - std::multimap&& operator>>(std::multimap&& l, - std::pair& o) - throw(std::exception) { - typename std::multimap::iterator it(l.begin()); - if (it==l.end()) - throw mrw::length_error(std::string(__FILE__ ":")+__LINE__+ - ": std::multimap<>::operator>>," - " multimap is empty"); - o = *it; - l.erase(it); - return l; -} -#endif //@} //@} diff --git a/src/mrw/multiset.hxx b/src/mrw/multiset.hxx index 328635a..347f5b7 100644 --- a/src/mrw/multiset.hxx +++ b/src/mrw/multiset.hxx @@ -49,21 +49,12 @@ @param o a value to be inserted into multiset @c l @pre \#include */ -#ifdef MRW__OLD_PRE11_COMPILER template std::multiset operator<<(std::multiset l, const T& o) throw(std::bad_exception) { l.insert(o); return l; } -#else -template - std::multiset&& operator<<(std::multiset&& l, const T& o) - throw(std::bad_exception) { - l.insert(o); - return l; -} -#endif /** @brief extract the first value of a multiset @@ -83,22 +74,8 @@ template shortened by the shifted element @pre \#include */ -#ifdef MRW__OLD_PRE11_COMPILER -template - std::multiset operator>>(std::multiset l, T& o) - throw(std::exception) { - typename std::multiset::iterator it(l.begin()); - if (it==l.end()) - throw mrw::length_error(std::string(__FILE__ ":")+__LINE__+ - ": std::multiset<> operator>>," - " multiset is empty"); - o = *it; - l.erase(it); - return l; -} -#else template - std::multiset&& operator>>(std::multiset&& l, T& o) + std::multiset& operator>>(std::multiset& l, T& o) throw(std::exception) { typename std::multiset::iterator it(l.begin()); if (it==l.end()) @@ -109,7 +86,6 @@ template l.erase(it); return l; } -#endif //@} //@} diff --git a/src/mrw/set.hxx b/src/mrw/set.hxx index d1dec66..88ddfc8 100644 --- a/src/mrw/set.hxx +++ b/src/mrw/set.hxx @@ -50,7 +50,6 @@ @param o a value to be inserted into set @c l @pre \#include */ -#ifdef MRW__OLD_PRE11_COMPILER template std::set operator<<(std::set l, const T& o) throw(std::exception) { @@ -60,17 +59,6 @@ template "set element already exists"); return l; } -#else -template - std::set&& operator<<(std::set&& l, const T& o) - throw(std::exception) { - if (!l.insert(o).second) - throw mrw::invalid_argument(std::string(__FILE__ ":")+__LINE__+ - ": std::set<> operator<<, " - "set element already exists"); - return l; -} -#endif /** @brief extract the first value of a set @@ -90,22 +78,8 @@ template shortened by the shifted element @pre \#include */ -#ifdef MRW__OLD_PRE11_COMPILER -template - std::set operator>>(std::set l, T& o) - throw(std::exception) { - typename std::set::iterator it(l.begin()); - if (it==l.end()) - throw mrw::length_error(std::string(__FILE__ ":")+__LINE__+ - ": std::set<> operator>>," - " set is empty"); - o = *it; - l.erase(it); - return l; -} -#else template - std::set operator>>(std::set l, T& o) + std::set& operator>>(std::set& l, T& o) throw(std::exception) { typename std::set::iterator it(l.begin()); if (it==l.end()) @@ -116,7 +90,6 @@ template l.erase(it); return l; } -#endif //@} //@} diff --git a/src/mrw/vector.hxx b/src/mrw/vector.hxx index 804ed1b..b2a8048 100644 --- a/src/mrw/vector.hxx +++ b/src/mrw/vector.hxx @@ -49,21 +49,12 @@ @param o a value to be inserted into vector @c l @pre \#include */ -#ifdef MRW__OLD_PRE11_COMPILER template std::vector operator<<(std::vector l, const T& o) throw(std::bad_exception) { l.push_back(o); return l; } -#else -template - std::vector&& operator<<(std::vector&& l, const T& o) - throw(std::bad_exception) { - l.push_back(o); - return l; -} -#endif /** @brief extract the first value of a vector @@ -83,22 +74,8 @@ template shortened by the shifted element @pre \#include */ -#ifdef MRW__OLD_PRE11_COMPILER -template -std::vector operator>>(std::vector l, T& o) - throw(std::exception) { - typename std::vector::iterator it(l.begin()); - if (it==l.end()) - throw mrw::length_error(std::string(__FILE__ ":")+__LINE__+ - ": std::vector<>& operator>>(std::vector<>&, T&)," - " vector is empty"); - o = *it; - l.erase(it); - return l; -} -#else template -std::vector&& operator>>(std::vector&& l, T& o) +std::vector& operator>>(std::vector& l, T& o) throw(std::exception) { typename std::vector::iterator it(l.begin()); if (it==l.end()) @@ -109,7 +86,6 @@ std::vector&& operator>>(std::vector&& l, T& o) l.erase(it); return l; } -#endif //@} //@}