Index: uspace/lib/cpp/include/impl/string.hpp
===================================================================
--- uspace/lib/cpp/include/impl/string.hpp	(revision e07bbbcbd9c70cedcf6d6bee645f72327f3b3e9e)
+++ uspace/lib/cpp/include/impl/string.hpp	(revision 9315761b1d19fc3fd4d317908974f1cd0d8ed4b4)
@@ -30,9 +30,14 @@
 #define LIBCPP_STRING
 
-#include <initializer_list>
+#include <algorithm>
 #include <iosfwd>
+#include <iterator>
 #include <cstdio>
 #include <cstdlib>
 #include <cstring>
+#include <memory>
+#include <utility>
+
+#include <initializer_list>
 
 namespace std
@@ -179,5 +184,7 @@
         static int compare(const char_type* s1, const char_type* s2, size_t n)
         {
-            return std::wstr_lcmp(s1, s2, n);
+            // TODO: This function does not exits...
+            //return std::wstr_lcmp(s1, s2, n);
+            return 0;
         }
 
@@ -260,6 +267,6 @@
             using reference       = value_type&;
             using const_reference = const value_type&;
-            using pointer         = allocator_traits<allocator_type>::pointer;
-            using const_pointer   = allocator_traits<allocator_type>::const_pointer;
+            using pointer         = typename allocator_traits<allocator_type>::pointer;
+            using const_pointer   = typename allocator_traits<allocator_type>::const_pointer;
 
             using iterator               = pointer;
@@ -286,6 +293,6 @@
                  *  capacity() = unspecified
                  */
-                data_ = allocator_.allocate(initial_capacity_);
-                capacity_ = initial_capacity_;
+                data_ = allocator_.allocate(default_capacity_);
+                capacity_ = default_capacity_;
             }
 
@@ -315,5 +322,5 @@
             }
 
-            basic_string(const value_type* str, size_type n, const allocator_type& alloc = allocator{})
+            basic_string(const value_type* str, size_type n, const allocator_type& alloc = allocator_type{})
                 : data_{}, size_{n}, capacity_{n}, allocator_{alloc}
             {
@@ -321,5 +328,5 @@
             }
 
-            basic_string(const value_type* str, const allocator_type& alloc = allocator{})
+            basic_string(const value_type* str, const allocator_type& alloc = allocator_type{})
                 : data_{}, size_{}, capacity_{}, allocator_{alloc}
             {
@@ -327,5 +334,5 @@
             }
 
-            basic_string(size_type n, value_type c, const allocator_type& alloc = allocator{})
+            basic_string(size_type n, value_type c, const allocator_type& alloc = allocator_type{})
                 : data_{}, size_{n}, capacity_{n}, allocator_{alloc}
             {
@@ -338,8 +345,8 @@
             template<class InputIterator>
             basic_string(InputIterator first, InputIterator last,
-                         const allocator_type& alloc = allocator{})
+                         const allocator_type& alloc = allocator_type{})
                 : data_{}, size_{}, capacity_{}, allocator_{alloc}
             {
-                if constexpr (is_integral_t<InputIterator>)
+                if constexpr (is_integral<InputIterator>::value)
                 { // Required by the standard.
                     size_ = static_cast<size_type>(first);
@@ -358,5 +365,5 @@
             }
 
-            basic_string(initializer_list<value_type> init, const allocator_type& alloc = allocator{})
+            basic_string(initializer_list<value_type> init, const allocator_type& alloc = allocator_type{})
                 : basic_string{init.begin(), init.size(), alloc}
             { /* DUMMY BODY */ }
@@ -629,5 +636,5 @@
             }
 
-            basic_string& append(const basic_string& str, size_type pos
+            basic_string& append(const basic_string& str, size_type pos,
                                  size_type n = npos)
             {
@@ -666,5 +673,5 @@
             basic_string& append(InputIterator first, InputIterator last)
             {
-                return append(basic_string(frist, last));
+                return append(basic_string(first, last));
             }
 
@@ -704,4 +711,6 @@
                 }
                 // TODO: Else throw out_of_range.
+
+                return *this;
             }
 
@@ -711,4 +720,6 @@
                 resize_without_copy_(n);
                 traits_type::copy(begin(), str, n);
+                size_ = n;
+                ensure_null_terminator_();
 
                 return *this;
@@ -792,7 +803,7 @@
                 copy_backward_(begin() + pos, end(), end() + n);
 
-                auto it = position;
+                auto it = pos;
                 for (size_type i = 0; i < n; ++i)
-                    type_traits::assign(*it++, c);
+                    traits_type::assign(*it++, c);
                 ensure_null_terminator_();
 
@@ -812,5 +823,5 @@
             }
 
-            basic_string& erase(size_type pos = 0; size_type n = npos)
+            basic_string& erase(size_type pos = 0, size_type n = npos)
             {
                 auto len = min(n, size_ - pos);
@@ -825,5 +836,5 @@
             {
                 auto idx = static_cast<size_type>(pos - cbegin());
-                erase(dx, 1);
+                erase(idx, 1);
 
                 return begin() + idx;
@@ -851,5 +862,5 @@
             }
 
-            basic_string& replace(size_type pos1, size_type n1, const basic_string& str
+            basic_string& replace(size_type pos1, size_type n1, const basic_string& str,
                                   size_type pos2, size_type n2 = npos)
             {
@@ -895,5 +906,5 @@
                                   const value_type* str, size_type n)
             {
-                return replace(i1 - begin(), i2 - i1, s, n);
+                return replace(i1 - begin(), i2 - i1, str, n);
             }
 
@@ -1256,5 +1267,5 @@
              * set capacity to 0, but that would be too cryptic.)
              */
-            static constexpr size_type default_capacity_{4}
+            static constexpr size_type default_capacity_{4};
 
             void init_(const value_type* str, size_type size)
@@ -1286,5 +1297,5 @@
                  *       reserve can cause shrinking.
                  */
-                if (size_ + 1 + n > capacity)
+                if (size_ + 1 + n > capacity_)
                     resize_with_copy_(size_, max(size_ + 1 + n, next_capacity_()));
             }
@@ -1342,5 +1353,6 @@
             void ensure_null_terminator_()
             {
-                traits_type::assign(data_[size_], value_type{});
+                value_type c{};
+                traits_type::assign(data_[size_], c);
             }
 
@@ -1369,4 +1381,6 @@
             }
     };
+
+    using string = basic_string<char>;
 }
 
