Index: uspace/lib/cpp/include/impl/istream.hpp
===================================================================
--- uspace/lib/cpp/include/impl/istream.hpp	(revision 51a3eef4884290bc7c158b7d11bf1463667a372c)
+++ uspace/lib/cpp/include/impl/istream.hpp	(revision a9caea1cfe6ab2808af93b68582ba61de1046aa6)
@@ -31,4 +31,5 @@
 
 #include <iosfwd>
+#include <utility>
 
 namespace std
@@ -54,12 +55,11 @@
 
             explicit basic_istream(basic_streambuf<Char, Traits>* sb)
-            {
-                // TODO: implement
+                : gcount_{0}
+            {
+                basic_ios::init(sb);
             }
 
             virtual ~basic_stream()
-            {
-                // TODO: implement
-            }
+            { /* DUMMY BODY */ }
 
             /**
@@ -67,5 +67,39 @@
              */
 
-            class sentry;
+            class sentry
+            {
+                public:
+                    explicit sentry(basic_istream<Char, Traits>& is, bool noskipws = false)
+                        : ok_{false}
+                    {
+                        if (!is.good())
+                            is.setstate(ios_base::failbit);
+                        else
+                        {
+                            if (is.tie())
+                                is.tie()->flush();
+
+                            if (!noskipws && ((is.flags() & ios_base::skipws) != 0))
+                            {
+                                // TODO: implement when we have istream_iterator and locale,
+                                //       skip whitespace using is.locale()
+                            }
+                        }
+                    }
+
+                    ~sentry() = default;
+
+                    explicit operator bool() const
+                    {
+                        return ok_;
+                    }
+
+                    sentry(const sentry&) = delete;
+                    sentry& operator=(const sentry&) = delete;
+
+                private:
+                    using traits_type = Traits;
+                    bool ok_;
+            }
 
             /**
@@ -170,5 +204,5 @@
             streamsize gcount() const
             {
-                // TODO: implement
+                return gcount_;
             }
 
@@ -264,9 +298,15 @@
 
         protected:
+            streamsize gcount_;
+
             basic_istream(const basic_istream&) = delete;
 
             basic_istream(basic_istream&& rhs)
             {
-                // TODO: implement
+                gcount_ = rhs.gcout_;
+
+                basic_ios::move(rhs);
+
+                rhs.gcount_ = 0;
             }
 
@@ -279,10 +319,13 @@
             basic_istream& operator=(basic_istream&& rhs)
             {
-                // TODO: implement
+                swap(rhs);
+
+                return *this;
             }
 
             void swap(basic_stream& rhs)
             {
-                // TODO: implement
+                basic_ios::swap(rhs);
+                swap(gcoung_, rhs.gcount_);
             }
     };
