diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2005-09-22 17:23:43 +0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2005-09-22 17:23:43 +0000 |
commit | ebfe57166dcf14b0033b4f3d3be3bb1289a19c07 (patch) | |
tree | 9b07dbd897a3d09162a1b281375b1fb960cfc35f /src/libstore/globals.cc | |
parent | 4578a490ce5a5a6325b4ff2b8f44468464de2d94 (diff) |
* Lets not go wild with templates.
Diffstat (limited to 'src/libstore/globals.cc')
-rw-r--r-- | src/libstore/globals.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/libstore/globals.cc b/src/libstore/globals.cc index 9a3ac6981..ef87e3ba8 100644 --- a/src/libstore/globals.cc +++ b/src/libstore/globals.cc @@ -26,9 +26,9 @@ static bool settingsRead = false; static map<string, Strings> settings; -template<class T, class A> A & genericAt(T & container, unsigned int n) +string & at(Strings & ss, unsigned int n) { - class T::iterator i = container.begin(); + Strings::iterator i =ss.begin(); advance(i, n); return *i; } @@ -55,10 +55,10 @@ static void readSettings() Strings tokens = tokenizeString(line); if (tokens.empty()) continue; - if (tokens.size() < 2 || genericAt<Strings, string>(tokens, 1) != "=") + if (tokens.size() < 2 || at(tokens, 1) != "=") throw Error(format("illegal configuration line `%1%' in `%2%'") % line % settingsFile); - string name = genericAt<Strings, string>(tokens, 0); + string name = at(tokens, 0); Strings::iterator i = tokens.begin(); advance(i, 2); @@ -79,6 +79,8 @@ Strings querySetting(const string & name, const Strings & def) bool queryBoolSetting(const string & name, bool def) { + debug("X"); + Strings defs; if (def) defs.push_back("true"); else defs.push_back("false"); |