aboutsummaryrefslogtreecommitdiff
path: root/desiredata/src/desire.h
diff options
context:
space:
mode:
authorN.N. <matju@users.sourceforge.net>2009-06-02 18:48:09 +0000
committerN.N. <matju@users.sourceforge.net>2009-06-02 18:48:09 +0000
commit6b3ce6286bef0d4d2ec8666923b9371814e501e1 (patch)
treeb87143b7d23ae4cbde8c936a7b402980ab645610 /desiredata/src/desire.h
parent8af0e1f8460c165c3444d01d2f128792eb60a6b7 (diff)
fix namespace problem with clip template
svn path=/trunk/; revision=11619
Diffstat (limited to 'desiredata/src/desire.h')
-rw-r--r--desiredata/src/desire.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/desiredata/src/desire.h b/desiredata/src/desire.h
index 56e0da0a..8d092e44 100644
--- a/desiredata/src/desire.h
+++ b/desiredata/src/desire.h
@@ -339,9 +339,11 @@ void glob_watchdog(t_pd *dummy);
#ifdef __cplusplus
#include<iostream>
+// should I remove min,max now? g++ complains about conflict between min and std::min...
+// they have the same def. btw i don't know how to refer to my own.
template <class T> static T min(T a, T b) {return a<b?a:b;}
template <class T> static T max(T a, T b) {return a>b?a:b;}
-template <class T> T clip(T a, T b, T c) {return min(max(a,b),c);}
+template <class T> T clip(T a, T b, T c) {return std::min(std::max(a,b),c);}
void oprintf(std::ostream &buf, const char *s, ...);
void voprintf(std::ostream &buf, const char *s, va_list args);
EXTERN std::ostringstream lost_posts;