summaryrefslogtreecommitdiff
path: root/hadori.C
diff options
context:
space:
mode:
authorTimo Weingärtner <timo@tiwe.de>2013-11-17 14:23:02 +0100
committerTimo Weingärtner <timo@tiwe.de>2013-11-17 14:47:04 +0100
commit75b33a7f64d2f04efeeb09f96e9b6be716a65526 (patch)
tree540f84738ed86fcd56b4dd4067b182b54a399c29 /hadori.C
parent9933463097df9fe16e446a0744204dbe04223544 (diff)
downloadhadori-75b33a7f64d2f04efeeb09f96e9b6be716a65526.tar.gz
tighten type requirements for range adaptors
Diffstat (limited to 'hadori.C')
-rw-r--r--hadori.C10
1 files changed, 6 insertions, 4 deletions
diff --git a/hadori.C b/hadori.C
index a96f1d6..f4f8e46 100644
--- a/hadori.C
+++ b/hadori.C
@@ -40,11 +40,13 @@ namespace po = boost::program_options;
// needed for equal_range and range-for
namespace std {
-template<typename T> T& begin(pair<T,T> & ip) {
- return ip.first;
+template<typename It>
+typename enable_if<is_base_of<input_iterator_tag, typename iterator_traits<It>::iterator_category>::value, It&>::type begin(pair<It,It> & p) {
+ return p.first;
}
-template<typename T> T& end(pair<T,T> & ip) {
- return ip.second;
+template<typename It>
+typename enable_if<is_base_of<input_iterator_tag, typename iterator_traits<It>::iterator_category>::value, It&>::type end(pair<It,It> & p) {
+ return p.second;
}
}