aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--butl/path10
-rw-r--r--butl/path.ixx8
2 files changed, 11 insertions, 7 deletions
diff --git a/butl/path b/butl/path
index aafc2aa..f679330 100644
--- a/butl/path
+++ b/butl/path
@@ -105,6 +105,16 @@ namespace butl
#endif
}
+ static bool
+ absolute (const string_type& s)
+ {
+#ifdef _WIN32
+ return s.size () > 1 && s[1] == ':';
+#else
+ return s.size () != 0 && is_separator (s[0]);
+#endif
+ }
+
static size_type
find_separator (string_type const& s,
size_type pos = 0,
diff --git a/butl/path.ixx b/butl/path.ixx
index 169f05d..8004821 100644
--- a/butl/path.ixx
+++ b/butl/path.ixx
@@ -83,13 +83,7 @@ namespace butl
inline bool basic_path<C, K>::
absolute () const
{
- const string_type& s (this->path_);
-
-#ifdef _WIN32
- return s.size () > 1 && s[1] == ':';
-#else
- return s.size () != 0 && traits::is_separator (s[0]);
-#endif
+ return traits::absolute (this->path_);
}
template <typename C, typename K>