Index: uspace/lib/cpp/include/impl/deque.hpp
===================================================================
--- uspace/lib/cpp/include/impl/deque.hpp	(revision 289c954aebdd98b5739ca9f41c604db78f4b0e03)
+++ uspace/lib/cpp/include/impl/deque.hpp	(revision db05684715bb45bac2fbea497dd4635974224e86)
@@ -425,6 +425,4 @@
                     fini_();
 
-                prepare_for_size_(other.size_);
-                init_();
                 copy_from_range_(other.begin(), other.end());
 
@@ -444,6 +442,4 @@
                     fini_();
 
-                prepare_for_size_(init.size());
-                init_();
                 copy_from_range_(init.begin(), init.end());
 
@@ -454,15 +450,21 @@
             void assign(InputIterator first, InputIterator last)
             {
-                // TODO: implement
+                copy_from_range_(first, last);
             }
 
             void assign(size_type n, const T& value)
             {
-                // TODO: implement
+                prepare_for_size_(n);
+                init_();
+                size_ = n;
+
+                auto it = begin();
+                for (size_type i = size_type{}; i < n; ++i)
+                    *it++ = value;
             }
 
             void assign(initializer_list<T> init)
             {
-                // TODO: implement
+                copy_from_range_(init.begin(), init.end());
             }
 
@@ -543,5 +545,5 @@
             size_type max_size() const noexcept
             {
-                return allocator_traits<Allocator>::max_size(allocator_);
+                return allocator_traits<allocator_type>::max_size(allocator_);
             }
 
@@ -643,5 +645,14 @@
             void emplace_front(Args&&... args)
             {
-                // TODO: implement
+                if (front_bucket_idx_ == 0)
+                    add_new_bucket_front_();
+
+                allocator_traits<allocator_type>::construct(
+                    allocator_,
+                    &data_[front_bucket_][--front_bucket_idx_],
+                    forward<Args>(args)...
+                );
+
+                ++size_;
             }
 
@@ -649,5 +660,14 @@
             void emplace_back(Args&&... args)
             {
-                // TODO: implement
+                allocator_traits<allocator_type>::construct(
+                    allocator_,
+                    &data_[back_bucket_][back_bucket_idx_++],
+                    forward<Args>(args)...
+                );
+
+                ++size_;
+
+                if (back_bucket_idx_ >= bucket_size_)
+                    add_new_bucket_back_();
             }
 
@@ -838,5 +858,5 @@
                     bucket_count_ = bucket_capacity_ = 2;
                 else if (size % bucket_size_ == 0)
-                    bucket_count_ = bucket_capacity_ = size / bucket_size_ + 1;
+                    bucket_count_ = bucket_capacity_ = size / bucket_size_ + 2;
                 else
                     bucket_count_ = bucket_capacity_ = size / bucket_size_ + 2;
@@ -844,4 +864,7 @@
                 front_bucket_ = 0;
                 back_bucket_ = bucket_capacity_ - 1;
+
+                front_bucket_idx_ = bucket_size_;
+                back_bucket_idx_ = size % bucket_size_;
             }
 
@@ -856,7 +879,4 @@
                 while (first != last)
                     *it++ = *first++;
-
-                // Remainder is the amount of elements in the last bucket.
-                back_bucket_idx_ = size_ % bucket_size_;
             }
 
