diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2017-04-20T14·52+0200 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2017-04-20T14·52+0200 |
commit | 4410e9d995bcd53a7a4cff0bbee3917375adcba3 (patch) | |
tree | 9798177ab77f4918c15f7f9b4061915e71bb79a6 /src/libstore/globals.cc | |
parent | f05d5f89ff4ec52ed2f6d576b2b2323b5292f815 (diff) |
Setting: Remove "Tag" template argument
Diffstat (limited to 'src/libstore/globals.cc')
-rw-r--r-- | src/libstore/globals.cc | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/src/libstore/globals.cc b/src/libstore/globals.cc index 6b9d077469c6..3242ef9d635e 100644 --- a/src/libstore/globals.cc +++ b/src/libstore/globals.cc @@ -73,7 +73,7 @@ unsigned int Settings::getDefaultCores() const string nixVersion = PACKAGE_VERSION; -template<> void Setting<SandboxMode>::set(const std::string & str) +template<> void BaseSetting<SandboxMode>::set(const std::string & str) { if (str == "true") value = smEnabled; else if (str == "relaxed") value = smRelaxed; @@ -81,7 +81,7 @@ template<> void Setting<SandboxMode>::set(const std::string & str) else throw UsageError("option '%s' has invalid value '%s'", name, str); } -template<> std::string Setting<SandboxMode>::to_string() +template<> std::string BaseSetting<SandboxMode>::to_string() { if (value == smEnabled) return "true"; else if (value == smRelaxed) return "relaxed"; @@ -89,27 +89,11 @@ template<> std::string Setting<SandboxMode>::to_string() else abort(); } -template<> void Setting<unsigned int, Settings::MaxBuildJobsTag>::set(const std::string & str) +void MaxBuildJobsSetting::set(const std::string & str) { if (str == "auto") value = std::max(1U, std::thread::hardware_concurrency()); else if (!string2Int(str, value)) throw UsageError("configuration setting ‘%s’ should be ‘auto’ or an integer", name); } -template<> std::string Setting<unsigned int, Settings::MaxBuildJobsTag>::to_string() -{ - return std::to_string(value); -} - -template<> void Setting<bool, Settings::CaseHackTag>::set(const std::string & str) -{ - value = parseBool(str); - nix::useCaseHack = true; -} - -template<> std::string Setting<bool, Settings::CaseHackTag>::to_string() -{ - return printBool(value); -} - } |