diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2013-01-19 19:20:25 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2013-01-19 19:20:25 +0100 |
commit | a37ea80991a15c4585862b0d890ed9622720129e (patch) | |
tree | 4332631f68d36106cd176db0c80af4ed62981a64 | |
parent | Copy and delete if we're between partitions. (diff) | |
download | music-file-organizer-a37ea80991a15c4585862b0d890ed9622720129e.tar.xz music-file-organizer-a37ea80991a15c4585862b0d890ed9622720129e.zip |
Use const ref on generics to please ##c++ people.
-rw-r--r-- | AudioFile.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/AudioFile.cpp b/AudioFile.cpp index db782ec..afb72b5 100644 --- a/AudioFile.cpp +++ b/AudioFile.cpp @@ -18,7 +18,7 @@ /* Turn a string into an integer type for any map class. */ template <typename T, typename M> -inline T extractTag(M &map, const char *key) +inline T extractTag(const M &map, const char *key) { T ret = 0; std::istringstream stream(extractTag<std::string>(map, key)); @@ -28,7 +28,7 @@ inline T extractTag(M &map, const char *key) /* Turn a string into a pair of integer types separated by a slash * for any map class. */ template <typename T1, typename T2, typename M> -inline std::pair<T1, T2> extractTag(M &map, const char *key) +inline std::pair<T1, T2> extractTag(const M &map, const char *key) { std::pair<T1, T2> values; values.first = 0; @@ -42,7 +42,7 @@ inline std::pair<T1, T2> extractTag(M &map, const char *key) } /* Turn a string into a bool, based on "1" and "true", for any map class. */ template <typename M> -inline bool extractTag(M &map, const char *key) +inline bool extractTag(const M &map, const char *key) { std::string str(extractTag<std::string>(map, key)); std::transform(str.begin(), str.end(), str.begin(), ::tolower); |