aboutsummaryrefslogtreecommitdiff
path: root/build2/config
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-02-12 16:10:48 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-02-12 16:10:48 +0200
commit4e665067ff264c55086fdfb776a95b0fbb4d432c (patch)
tree2371403561c0a3d754792f68d2515cae71dff565 /build2/config
parent00ed965e4a29f66666d2bf4372d2d6919c29664e (diff)
<types>/<utility> scheme cleanup
Diffstat (limited to 'build2/config')
-rw-r--r--build2/config/module.cxx2
-rw-r--r--build2/config/operation3
-rw-r--r--build2/config/utility24
-rw-r--r--build2/config/utility.txx6
4 files changed, 18 insertions, 17 deletions
diff --git a/build2/config/module.cxx b/build2/config/module.cxx
index d3fb45b..11b7aa1 100644
--- a/build2/config/module.cxx
+++ b/build2/config/module.cxx
@@ -54,7 +54,7 @@ namespace build2
config_init (scope& root,
scope&,
const location& l,
- std::unique_ptr<module>&,
+ unique_ptr<module>&,
bool first,
bool)
{
diff --git a/build2/config/operation b/build2/config/operation
index 0a89694..ad010df 100644
--- a/build2/config/operation
+++ b/build2/config/operation
@@ -5,6 +5,9 @@
#ifndef BUILD2_CONFIG_OPERATION
#define BUILD2_CONFIG_OPERATION
+#include <build2/types>
+#include <build2/utility>
+
#include <build2/operation>
namespace build2
diff --git a/build2/config/utility b/build2/config/utility
index 95ec258..2f53521 100644
--- a/build2/config/utility
+++ b/build2/config/utility
@@ -5,11 +5,9 @@
#ifndef BUILD2_CONFIG_UTILITY
#define BUILD2_CONFIG_UTILITY
-#include <string>
-#include <utility> // pair
-#include <functional> // reference_wrapper
-
#include <build2/types>
+#include <build2/utility>
+
#include <build2/variable>
#include <build2/diagnostics>
@@ -29,29 +27,29 @@ namespace build2
// whether the variable has actually been set.
//
template <typename T>
- std::pair<std::reference_wrapper<const value>, bool>
+ pair<reference_wrapper<const value>, bool>
required (scope& root,
const variable&,
const T& default_value,
bool override = false);
template <typename T>
- inline std::pair<std::reference_wrapper<const value>, bool>
+ inline pair<reference_wrapper<const value>, bool>
required (scope& root,
- const std::string& name,
+ const string& name,
const T& default_value,
bool override = false)
{
return required (root, var_pool.find (name), default_value, override);
}
- inline std::pair<std::reference_wrapper<const value>, bool>
+ inline pair<reference_wrapper<const value>, bool>
required (scope& root,
- const std::string& name,
+ const string& name,
const char* default_value,
bool override = false)
{
- return required (root, name, std::string (default_value), override);
+ return required (root, name, string (default_value), override);
}
// Set, if necessary, an optional config.* variable. In particular,
@@ -65,7 +63,7 @@ namespace build2
optional (scope& root, const variable&);
inline const value&
- optional (scope& root, const std::string& var)
+ optional (scope& root, const string& var)
{
return optional (root, var_pool.find (var));
}
@@ -78,7 +76,7 @@ namespace build2
optional_absolute (scope& root, const variable&);
inline const value&
- optional_absolute (scope& root, const std::string& var)
+ optional_absolute (scope& root, const string& var)
{
return optional_absolute (root, var_pool.find (var));
}
@@ -95,7 +93,7 @@ namespace build2
// "remember" that it is unconfigured.
//
bool
- specified (scope& root, const std::string& ns);
+ specified (scope& root, const string& ns);
// @@ Why are these here?
//
diff --git a/build2/config/utility.txx b/build2/config/utility.txx
index 3fc40c0..fd32599 100644
--- a/build2/config/utility.txx
+++ b/build2/config/utility.txx
@@ -9,10 +9,10 @@ namespace build2
namespace config
{
template <typename T>
- std::pair<std::reference_wrapper<const value>, bool>
+ pair<reference_wrapper<const value>, bool>
required (scope& root, const variable& var, const T& def_value, bool ovr)
{
- using result = std::pair<std::reference_wrapper<const value>, bool>;
+ using result = pair<reference_wrapper<const value>, bool>;
if (auto l = root[var])
{
@@ -32,7 +32,7 @@ namespace build2
{
if (auto l = s[var])
{
- for (const std::string& s: as<strings> (*l))
+ for (const string& s: as<strings> (*l))
{
if (s == option)
return true;