Index: trunk/include/iprt/nocrt/algorithm
===================================================================
--- trunk/include/iprt/nocrt/algorithm	(revision 95993)
+++ trunk/include/iprt/nocrt/algorithm	(revision 95993)
@@ -0,0 +1,53 @@
+/** @file
+ * IPRT / No-CRT - Minimal C++ algorithm header.
+ */
+
+/*
+ * Copyright (C) 2022 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ *
+ * The contents of this file may alternatively be used under the terms
+ * of the Common Development and Distribution License Version 1.0
+ * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
+ * VirtualBox OSE distribution, in which case the provisions of the
+ * CDDL are applicable instead of those of the GPL.
+ *
+ * You may elect to license modified versions of this file under the
+ * terms and conditions of either the GPL or the CDDL or both.
+ */
+
+#ifndef IPRT_INCLUDED_nocrt_algorithm
+#define IPRT_INCLUDED_nocrt_algorithm
+#ifndef RT_WITHOUT_PRAGMA_ONCE
+# pragma once
+#endif
+
+#ifdef _MSC_VER
+# pragma warning(push)
+# pragma warning(disable: 4643) /* warning C4643: Forward declaring 'ios_base' in namespace std is not permitted by the C++ Standard */
+#endif
+
+namespace std
+{
+    template<typename a_RandomIt>
+    void sort(a_RandomIt a_ItBegin, a_RandomIt a_ItEnd);
+
+    template<typename a_RandomIt, typename a_Compare>
+    void sort(a_RandomIt a_ItBegin, a_RandomIt a_ItEnd, a_Compare);
+
+}
+
+#ifdef _MSC_VER
+# pragma warning(pop)
+#endif
+
+#endif /* !IPRT_INCLUDED_nocrt_algorithm */
+
+
Index: trunk/include/iprt/nocrt/cassert
===================================================================
--- trunk/include/iprt/nocrt/cassert	(revision 95993)
+++ trunk/include/iprt/nocrt/cassert	(revision 95993)
@@ -0,0 +1,39 @@
+/** @file
+ * IPRT / No-CRT - Minimal C++ cassert header.
+ */
+
+/*
+ * Copyright (C) 2022 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ *
+ * The contents of this file may alternatively be used under the terms
+ * of the Common Development and Distribution License Version 1.0
+ * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
+ * VirtualBox OSE distribution, in which case the provisions of the
+ * CDDL are applicable instead of those of the GPL.
+ *
+ * You may elect to license modified versions of this file under the
+ * terms and conditions of either the GPL or the CDDL or both.
+ */
+
+#ifndef IPRT_INCLUDED_nocrt_cassert
+#define IPRT_INCLUDED_nocrt_cassert
+#ifndef RT_WITHOUT_PRAGMA_ONCE
+# pragma once
+#endif
+
+#include <iprt/nocrt/assert.h>
+
+namespace std
+{
+}
+
+#endif /* !IPRT_INCLUDED_nocrt_cassert */
+
Index: trunk/include/iprt/nocrt/float.h
===================================================================
--- trunk/include/iprt/nocrt/float.h	(revision 95985)
+++ trunk/include/iprt/nocrt/float.h	(revision 95993)
@@ -43,9 +43,16 @@
 #if defined(RT_ARCH_X86) || defined(RT_ARCH_AMD64) || defined(RT_ARCH_ARM64)
 
-# define FLT_MAX        (3.40282347E+38F)
-# define FLT_MIN        (1.17549435E-38F)
-# define FLT_MAX_EXP    (128)
-# define FLT_MIN_EXP    (-125)
-# define FLT_EPSILON    (1.192092896E-07F)
+# define FLT_MAX            (3.40282347E+38F)
+# define FLT_MIN            (1.17549435E-38F)
+# define FLT_TRUE_MIN       (1.40129846E-45F)
+# define FLT_MAX_EXP        (128)
+# define FLT_MIN_EXP        (-125)
+# define FLT_MAX_10_EXP     (38)
+# define FLT_MIN_10_EXP     (-37)
+# define FLT_EPSILON        (1.192092896E-07F)
+# define FLT_DIG            (6)
+# define FLT_DECIMAL_DIG    (9)
+# define FLT_MANT_DIG       (24)
+# define FLT_HAS_SUBNORM    (1)
 
 #endif
@@ -56,9 +63,16 @@
 #if defined(RT_ARCH_X86) || defined(RT_ARCH_AMD64) || defined(RT_ARCH_ARM64)
 
-# define DBL_MAX        (1.7976931348623157E+308)
-# define DBL_MIN        (2.2250738585072014E-308)
-# define DBL_MAX_EXP    (1024)
-# define DBL_MIN_EXP    (-1021)
-# define DBL_EPSILON    (2.2204460492503131E-16)
+# define DBL_MAX            (1.7976931348623157E+308)
+# define DBL_MIN            (2.2250738585072014E-308)
+# define DBL_TRUE_MIN       (4.9406564584124654E-324)
+# define DBL_MAX_EXP        (1024)
+# define DBL_MIN_EXP        (-1021)
+# define DBL_MAX_10_EXP     (308)
+# define DBL_MIN_10_EXP     (-307)
+# define DBL_EPSILON        (2.2204460492503131E-16)
+# define DBL_DIG            (15)
+# define DBL_DECIMAL_DIG    (17)
+# define DBL_MANT_DIG       (53)
+# define DBL_HAS_SUBNORM    (1)
 
 #endif
@@ -67,10 +81,34 @@
  * long double
  */
-#if (defined(RT_ARCH_X86) || defined(RT_ARCH_AMD64)) && defined(RT_OS_WINDOWS)
-# define LDBL_MAX        DBL_MAX
-# define LDBL_MIN        DBL_MIN
-# define LDBL_MAX_EXP    DBL_MAX_EXP
-# define LDBL_MIN_EXP    DBL_MIN_EXP
-# define LDBL_EPSIOLON   DBL_EPSIOLON
+#if ((defined(RT_ARCH_X86) || defined(RT_ARCH_AMD64)) && defined(RT_OS_WINDOWS)) || defined(RT_ARCH_ARM64) /*?*/
+
+# define LDBL_MAX           DBL_MAX
+# define LDBL_MIN           DBL_MIN
+# define LDBL_TRUE_MIN      DBL_TRUE_MIN
+# define LDBL_MAX_EXP       DBL_MAX_EXP
+# define LDBL_MIN_EXP       DBL_MIN_EXP
+# define LDBL_MAX_10_EXP    DBL_MAX_10_EXP
+# define LDBL_MIN_10_EXP    DBL_MIN_10_EXP
+# define LDBL_EPSILON       DBL_EPSILON
+# define LDBL_DIG           DBL_DIG
+# define LDBL_DECIMAL_DIG   DBL_DECIMAL_DIG
+# define LDBL_MANT_DIG      DBL_MANT_DIG
+# define LDBL_HAS_SUBNORM   DBL_HAS_SUBNORM
+
+#elif defined(RT_ARCH_X86) || defined(RT_ARCH_AMD64)
+
+# define LDBL_MAX           (1.1897314953572317650E+4932L)
+# define LDBL_MIN           (3.3621031431120935063E-4932L)
+# define LDBL_TRUE_MIN      (3.6451995318824746025E-4951L)
+# define LDBL_MAX_EXP       (-16381)
+# define LDBL_MIN_EXP       (16384)
+# define LDBL_MAX_10_EXP    (4932)
+# define LDBL_MIN_10_EXP    (-4931)
+# define LDBL_EPSILON       (1.0842021724855044340E-19L)
+# define LDBL_DIG           (18)
+# define LDBL_DECIMAL_DIG   (21)
+# define LDBL_MANT_DIG      (64)
+# define LDBL_HAS_SUBNORM   (1)
+
 #endif
 
Index: trunk/include/iprt/nocrt/fstream
===================================================================
--- trunk/include/iprt/nocrt/fstream	(revision 95993)
+++ trunk/include/iprt/nocrt/fstream	(revision 95993)
@@ -0,0 +1,196 @@
+/** @file
+ * IPRT / No-CRT - Minimal C++ fstream header.
+ */
+
+/*
+ * Copyright (C) 2022 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ *
+ * The contents of this file may alternatively be used under the terms
+ * of the Common Development and Distribution License Version 1.0
+ * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
+ * VirtualBox OSE distribution, in which case the provisions of the
+ * CDDL are applicable instead of those of the GPL.
+ *
+ * You may elect to license modified versions of this file under the
+ * terms and conditions of either the GPL or the CDDL or both.
+ */
+
+#ifndef IPRT_INCLUDED_nocrt_fstream
+#define IPRT_INCLUDED_nocrt_fstream
+#ifndef RT_WITHOUT_PRAGMA_ONCE
+# pragma once
+#endif
+
+#include <iprt/nocrt/ostream>
+#include <iprt/stream.h>
+
+
+namespace std
+{
+    template<typename a_CharType, typename a_CharTraits /*= std::char_traits<a_CharType>*/ >
+    class basic_filebuf : public basic_streambuf<a_CharType, a_CharTraits>
+    {
+    protected:
+        PRTSTREAM           m_pStrm;
+        bool                m_fStdStream;
+        ios_base::openmode  m_fMode;
+
+    public:
+        basic_filebuf(PRTSTREAM a_pStrm = NULL, bool a_fStdStream = false)
+            : basic_streambuf()
+            , m_pStrm(a_pStrm)
+            , m_fStdStream(a_fStdStream)
+            , m_fMode(ios_base::openmode(0))
+        {
+        }
+
+        virtual ~basic_filebuf()
+        {
+            if (m_pStrm)
+            {
+                if (m_fStdStream)
+                    RTStrmClose(m_pStrm);
+                m_pStrm = NULL;
+            }
+        }
+
+        bool is_open() const RT_NOEXCEPT
+        {
+            return m_pStrm != NULL;
+        }
+
+        basic_filebuf *open(const char *a_pszFilename, ios_base::openmode a_fMode)
+        {
+            /*
+             * Sanitize the a_fMode first.
+             */
+            AssertReturn(!is_open(), NULL);
+            AssertReturn(a_fMode & (ios_base::out | ios_base::in), NULL); /* Neither write nor read mode? */
+            AssertStmt((a_fMode & (ios_base::out | ios_base::app))     != ios_base::app,   a_fMode &= ~ios_base::app);
+            AssertReturn((a_fMode & (ios_base::out | ios_base::trunc)) != ios_base::trunc, NULL);
+            AssertReturn(!(a_fMode & ios_base::trunc) || !(a_fMode & ios_base::app), NULL);
+
+            /*
+             * Translate a_fMode into a stream mode string and try open the file.
+             */
+            char szMode[8];
+            szMode[0] = a_fMode & ios_base::trunc ? 'w' : a_fMode & ios_base::app ? 'a' : 'r';
+            size_t offMode = 1;
+            if ((a_fMode & (ios_base::in | ios_base::out)) == (ios_base::in | ios_base::out))
+                szMode[offMode++] = '+';
+            if (a_fMode & ios_base::binary)
+                szMode[offMode++] = 'b';
+            szMode[offMode] = '\0';
+
+            int rc = RTStrmOpen(a_pszFilename, szMode, &m_pStrm);
+            if (RT_SUCCESS(rc))
+            {
+                /** @todo if (a_fMode & ios_base::ate)? */
+
+                /*
+                 * Set up the buffer?
+                 */
+                if (true)
+                {
+                    return this;
+                }
+
+                RTStrmClose(m_pStrm);
+                m_pStrm = NULL;
+            }
+            return NULL;
+        }
+
+    protected:
+        bool flushBuffered()
+        {
+            /** @todo buffering. */
+            return true;
+        }
+
+        //virtual int_type overflow(int_type a_iChar) RT_OVERRIDE
+        //{
+        //    if (a_iChar != traits_type::eof())
+        //    {
+        //        if (flushBuffered())
+        //        {
+        //            char_type ch = traits_type::to_char_type(a_iChar);
+        //            int rc = RTStrmWrite(m_pStrm, &ch, sizeof(ch));
+        //            if (RT_SUCCESS(rc))
+        //                return a_iChar;
+        //        }
+        //    }
+        //    return traits_type::eof();
+        //}
+
+        std::streamsize xsputn(char_type const *a_pchSrc, std::streamsize a_cchSrc) //RT_OVERRIDE
+        {
+            if (flushBuffered())
+            {
+                size_t cbWritten = 0;
+                int rc = RTStrmWriteEx(m_pStrm, &a_pchSrc, sizeof(a_pchSrc[0]) * a_cchSrc, &cbWritten);
+                if (RT_SUCCESS(rc))
+                    return cbWritten / sizeof(a_pchSrc[0]);
+            }
+            return 0;
+        }
+    };
+
+
+    /**
+     * Basic I/O stream.
+     */
+    template<typename a_CharType, typename a_CharTraits /*= std::char_traits<a_CharType>*/ >
+    class basic_ofstream : public basic_ostream<a_CharType, a_CharTraits>
+    {
+    protected:
+        basic_filebuf<a_CharType, a_CharTraits> m_FileBuf;
+
+    public:
+        basic_ofstream()
+            : basic_ostream(&m_FileBuf) /** @todo m_FileBuf isn't initialized yet... */
+            , m_FileBuf()
+        {
+        }
+
+        explicit basic_ofstream(const char *a_pszFilename, ios_base::openmode a_fMode = ios_base::out)
+            : basic_ostream(&m_FileBuf) /** @todo m_FileBuf isn't initialized yet... */
+            , m_FileBuf()
+        {
+            m_FileBuf.open(a_pszFilename, a_fMode);
+        }
+    private:
+        basic_ofstream(basic_ofstream const &a_rSrc);               /* no copying */
+        basic_ofstream &operator=(basic_ofstream const &a_rSrc);    /* no copying */
+
+    public:
+        virtual ~basic_ofstream()
+        {
+        }
+
+    public:
+
+        bool is_open() const RT_NOEXCEPT
+        {
+            return m_FileBuf.is_open();
+        }
+
+        basic_filebuf<a_CharType, a_CharTraits> *open(const char *a_pszFilename, ios_base::openmode a_fMode)
+        {
+            return m_FileBuf.open(a_pszFilename, a_fMode);
+        }
+
+
+    };
+}
+
+#endif /* !IPRT_INCLUDED_nocrt_fstream */
+
Index: trunk/include/iprt/nocrt/iomanip
===================================================================
--- trunk/include/iprt/nocrt/iomanip	(revision 95993)
+++ trunk/include/iprt/nocrt/iomanip	(revision 95993)
@@ -0,0 +1,156 @@
+/** @file
+ * IPRT / No-CRT - Minimal C++ iomanip header.
+ */
+
+/*
+ * Copyright (C) 2022 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ *
+ * The contents of this file may alternatively be used under the terms
+ * of the Common Development and Distribution License Version 1.0
+ * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
+ * VirtualBox OSE distribution, in which case the provisions of the
+ * CDDL are applicable instead of those of the GPL.
+ *
+ * You may elect to license modified versions of this file under the
+ * terms and conditions of either the GPL or the CDDL or both.
+ */
+
+#ifndef IPRT_INCLUDED_nocrt_iomanip
+#define IPRT_INCLUDED_nocrt_iomanip
+#ifndef RT_WITHOUT_PRAGMA_ONCE
+# pragma once
+#endif
+
+#include <iprt/nocrt/ios>
+
+
+namespace std
+{
+    /**
+     * Used by all flag manipulators.
+     */
+    struct rtNoCrtIosSetFlagsEx
+    {
+        ios_base::fmtflags m_fSet;
+        ios_base::fmtflags m_fMask;
+    };
+
+    template<typename a_CharType, typename a_CharTraits>
+    inline basic_istream<a_CharType, a_CharTraits> &operator>>(basic_istream<a_CharType, a_CharTraits> &a_rSrc,
+                                                               struct rtNoCrtIosSetFlagsEx a_Change)
+    {
+        a_rSrc.setf(a_Change.m_fSet, a_Change.m_fMask);
+        return a_rSrc;
+    }
+
+    template<typename a_CharType, typename a_CharTraits>
+    inline basic_ostream<a_CharType, a_CharTraits> &operator<<(basic_ostream<a_CharType, a_CharTraits> &a_rDst,
+                                                               struct rtNoCrtIosSetFlagsEx a_Change)
+    {
+        a_rDst.setf(a_Change.m_fSet, a_Change.m_fMask);
+        return a_rDst;
+    }
+
+
+    /*
+     * Flag modification functions.
+     */
+
+    inline struct rtNoCrtIosSetFlagsEx setiosflags(ios_base::fmtflags a_fFlags)
+    {
+        struct rtNoCrtIosSetFlagsEx Ret = { a_fFlags, a_fFlags };
+        return Ret;
+    }
+
+    inline struct rtNoCrtIosSetFlagsEx resetiosflags(ios_base::fmtflags a_fFlags)
+    {
+        struct rtNoCrtIosSetFlagsEx Ret = { ios_base::fmtflags(0), a_fFlags };
+        return Ret;
+    }
+
+    inline struct rtNoCrtIosSetFlagsEx setbase(int a_iBase)
+    {
+        struct rtNoCrtIosSetFlagsEx Ret =
+        {
+              a_iBase == 10 ? ios_base::dec
+            : a_iBase == 16 ? ios_base::hex
+            : a_iBase == 8  ? ios_base::oct
+            : ios_base::fmtflags(0),
+            ios_base::basefield
+        };
+        return Ret;
+    }
+
+    /*
+     * Modify precision.
+     */
+    struct rtNoCrtIosSetPrecision
+    {
+        int m_cchPrecision;
+    };
+
+    template<typename a_CharType, typename a_CharTraits>
+    inline basic_istream<a_CharType, a_CharTraits> &operator>>(basic_istream<a_CharType, a_CharTraits> &a_rSrc,
+                                                               struct rtNoCrtIosSetPrecision a_Change)
+    {
+        a_rSrc.precision(a_Change.m_cchPrecision);
+        return a_rSrc;
+    }
+
+    template<typename a_CharType, typename a_CharTraits>
+    inline basic_ostream<a_CharType, a_CharTraits> &operator<<(basic_ostream<a_CharType, a_CharTraits> &a_rDst,
+                                                               struct rtNoCrtIosSetPrecision a_Change)
+    {
+        a_rDst.precision(a_Change.m_cchPrecision);
+        return a_rDst;
+    }
+
+    inline struct rtNoCrtIosSetPrecision setprecision(int a_cchPrecision)
+    {
+        struct rtNoCrtIosSetPrecision Ret = { a_cchPrecision };
+        return Ret;
+    }
+
+    /*
+     * Modify width.
+     */
+    struct rtNoCrtIosSetWidth
+    {
+        int m_cchWidth;
+    };
+
+    template<typename a_CharType, typename a_CharTraits>
+    inline basic_istream<a_CharType, a_CharTraits> &operator>>(basic_istream<a_CharType, a_CharTraits> &a_rSrc,
+                                                               struct rtNoCrtIosSetWidth a_Change)
+    {
+        a_rSrc.width(a_Change.m_cchWidth);
+        return a_rSrc;
+    }
+
+    template<typename a_CharType, typename a_CharTraits>
+    inline basic_ostream<a_CharType, a_CharTraits> &operator<<(basic_ostream<a_CharType, a_CharTraits> &a_rDst,
+                                                               struct rtNoCrtIosSetWidth a_Change)
+    {
+        a_rDst.width(a_Change.m_cchWidth);
+        return a_rDst;
+    }
+
+    inline struct rtNoCrtIosSetWidth setw(int a_cchWidth)
+    {
+        struct rtNoCrtIosSetWidth Ret = { a_cchWidth };
+        return Ret;
+    }
+
+    /** @todo setfil, get_money, set_money, get_time, set_time */
+}
+
+#endif /* !IPRT_INCLUDED_nocrt_iomanip */
+
Index: trunk/include/iprt/nocrt/ios
===================================================================
--- trunk/include/iprt/nocrt/ios	(revision 95985)
+++ trunk/include/iprt/nocrt/ios	(revision 95993)
@@ -54,65 +54,69 @@
 namespace std
 {
-    typedef RTFOFF streamsize;
+    typedef ptrdiff_t streamsize;
 
     /**
      * I/O stream format flags.
      */
-    enum rtNoCrtIosFmtFlags
+    class rtNoCrtIosEnums
     {
-        /* int: */
-        dec         = 0x00000001,
-        oct         = 0x00000002,
-        hex         = 0x00000004,
-        basefield   = 0x00000007,
-        /* float: */
-        scientific  = 0x00000010,
-        fixed       = 0x00000020,
-        floatfield  = 0x00000030,
-        /* int and float output tweaks: */
-        showbase    = 0x00000100,
-        showpoint   = 0x00000200,
-        showpos     = 0x00000400,
-        /* bool: */
-        boolalpha   = 0x00000800,
-        /* adjustment: */
-        left        = 0x00001000,
-        right       = 0x00002000,
-        internal    = 0x00004000,
-        adjustfield = 0x00007000,
-        /* misc: */
-        skipws      = 0x00010000,
-        unitbuf     = 0x00020000,
-        uppercase   = 0x00040000,
+    public:
+        enum fmtflags
+        {
+            /* int: */
+            dec         = 0x00000001,
+            oct         = 0x00000002,
+            hex         = 0x00000004,
+            basefield   = 0x00000007,
+            /* float: */
+            scientific  = 0x00000010,
+            fixed       = 0x00000020,
+            floatfield  = 0x00000030,
+            /* int and float output tweaks: */
+            showbase    = 0x00000100,
+            showpoint   = 0x00000200,
+            showpos     = 0x00000400,
+            /* bool: */
+            boolalpha   = 0x00000800,
+            /* adjustment: */
+            left        = 0x00001000,
+            right       = 0x00002000,
+            internal    = 0x00004000,
+            adjustfield = 0x00007000,
+            /* misc: */
+            skipws      = 0x00010000,
+            unitbuf     = 0x00020000,
+            uppercase   = 0x00040000,
+        };
+
+        enum seekdir
+        {
+            beg = 1,
+            end,
+            cur,
+        };
+
+        enum openmode
+        {
+            app = 1,
+            binary,
+            in,
+            out,
+            trunc,
+            ate
+        };
+
+        enum iostate
+        {
+            goodbit = 0,
+            badbit  = 1,
+            failbit = 2,
+            eofbit  = 4
+        };
     };
-    RTNOCRT_IOS_ENUM_BIT_OPS(rtNoCrtIosFmtFlags, int)
-
-    enum rtNoCrtIosSeekDir
-    {
-        beg = 1,
-        end,
-        cur,
-    };
-    RTNOCRT_IOS_ENUM_BIT_OPS(rtNoCrtIosSeekDir, int)
-
-    enum rtNoCrtIosOpenMode
-    {
-        app = 1,
-        binary,
-        in,
-        out,
-        trunc,
-        ate
-    };
-    RTNOCRT_IOS_ENUM_BIT_OPS(rtNoCrtIosOpenMode, int)
-
-    enum rtNoCrtIosState
-    {
-        goodbit = 0,
-        badbit  = 1,
-        failbit = 2,
-        eofbit  = 4
-    };
-    RTNOCRT_IOS_ENUM_BIT_OPS(rtNoCrtIosState, int)
+    RTNOCRT_IOS_ENUM_BIT_OPS(rtNoCrtIosEnums::fmtflags, int)
+    RTNOCRT_IOS_ENUM_BIT_OPS(rtNoCrtIosEnums::seekdir, int)
+    RTNOCRT_IOS_ENUM_BIT_OPS(rtNoCrtIosEnums::openmode, int)
+    RTNOCRT_IOS_ENUM_BIT_OPS(rtNoCrtIosEnums::iostate, int)
 
 
@@ -120,11 +124,11 @@
      * I/O stream base class.
      */
-    class ios_base
+    class ios_base : public rtNoCrtIosEnums
     {
     public:
-        typedef rtNoCrtIosFmtFlags fmtflags;
-        typedef rtNoCrtIosSeekDir  seekdir;
-        typedef rtNoCrtIosOpenMode openmode;
-        typedef rtNoCrtIosState    iostate;
+        //typedef rtNoCrtIosFmtFlags fmtflags;
+        //typedef rtNoCrtIosSeekDir  seekdir;
+        //typedef rtNoCrtIosOpenMode openmode;
+        //typedef rtNoCrtIosState    iostate;
 
     protected:
@@ -222,9 +226,59 @@
 
     protected:
-        basic_streambuf()
-        {
-        }
-
-        basic_streambuf(const basic_streambuf &a_rSrc)
+        /** @name Put buffering
+         * @{ */
+        char_type   *m_pachPut;     /**< The put buffer pointer. */
+        std::size_t  m_cchPut;      /**< Put buffer size. */
+        std::size_t  m_offPutNext;  /**< The current put buffer position (where to write next). */
+        std::size_t  m_offPutStart; /**< Where the buffered put sequence starts. */
+
+        void setp(char_type *a_pachNewBuf, char_type *a_pachNewBufEnd)
+        {
+            Assert((uintptr_t)a_pachNewBuf <= (uintptr_t)a_pachNewBufEnd);
+            m_pachPut     = a_pachNewBuf;
+            m_cchPut      = static_cast<std::size_t>(a_pachNewBufEnd - a_pachNewBuf);
+            m_offPutNext  = 0;
+            m_offPutStart = 0;
+        }
+
+        char_type *pbbase() const RT_NOEXCEPT
+        {
+            Assert(m_offPutNext >= m_offPutStart); Assert(m_offPutNext <= m_cchPut); Assert(m_offPutStart <= m_cchPut);
+            return &m_pachPut[m_offPutStart];
+        }
+
+        char_type *pptr()  const RT_NOEXCEPT
+        {
+            Assert(m_offPutNext <= m_cchPut);
+            return &m_pachPut[m_offPutNext];
+        }
+
+        char_type *epptr()  const RT_NOEXCEPT
+        {
+            return &m_pachBuf[m_cchPut];
+        }
+
+        void pbump(int a_cchAdvance)  const RT_NOEXCEPT
+        {
+            Assert(m_offPutNext <= m_cchPut);
+            m_offPutNext      += a_cchAdvance;
+            Assert(m_offPutNext <= m_cchPut);
+        }
+        /** @} */
+
+    protected:
+        basic_streambuf() RT_NOEXCEPT
+            : m_pachPut(NULL)
+            , m_cchPut(0)
+            , m_offPutNext(0)
+            , m_offPutStart(0)
+        {
+        }
+
+        basic_streambuf(const basic_streambuf &a_rSrc) RT_NOEXCEPT
+            : m_pachPut(a_rSrc.m_pachPut)
+            , m_cchPut(a_rSrc.m_cchPut)
+            , m_offPutNext(a_rSrc.m_offPutNext)
+            , m_offPutStart(a_rSrc.m_offPutStart)
         {
         }
@@ -246,5 +300,5 @@
         basic_streambuf *pubsetbuf(char_type *a_pchBuf, std::streamsize a_cchBuf)
         {
-            return setbuf(a_off, a_enmDir, a_enmTarget);
+            return setbuf(a_pchBuf, a_cchBuf);
         }
 
@@ -253,5 +307,5 @@
                                  std::ios_base::openmode a_enmTarget = ios_base::in | ios_base::out)
         {
-            RT_NOREF(a_off, a_enmDir, out);
+            RT_NOREF(a_off, a_enmDir, a_enmTarget);
             return pos_type(off_type(-1));
         }
@@ -266,5 +320,5 @@
         virtual pos_type seekpos(pos_type a_pos, std::ios_base::openmode a_enmTarget = ios_base::in | ios_base::out)
         {
-            RT_NOREF(a_off, a_enmDir, out);
+            RT_NOREF(a_pos, a_enmTarget);
             return pos_type(off_type(-1));
         }
@@ -287,5 +341,58 @@
         /** @} */
 
-        /** @todo add the remainin members... */
+        /** @name Output
+         * @{ */
+    protected:
+        virtual int_type overflow(int_type a_iChar)
+        {
+            RT_NOREF(a_iChar);
+            return traits_type::eof();
+        }
+
+        virtual std::streamsize xsputn(char_type const *a_pchSrc, std::streamsize a_cchSrc)
+        {
+            std::streamsize cchWritten = 0;
+            while (a_cchSrc > 0)
+            {
+                std::size_t cchCopied = m_cchPut - m_offPutNext;
+                if (cchCopied > 0)
+                {
+                    cchCopied = RT_MIN(cchCopied, a_cchSrc);
+                    traits_type::copy(&m_pachPut[m_offPutNext], a_pchSrc, cchCopied);
+                    m_cchPut += cchCopied;
+                }
+                else
+                {
+                    if (overflow(traits_type::to_int_type(m_pachPut[m_offPutNext])) != traits_type::eof())
+                        cchCopied = 1;
+                    else
+                        break;
+                }
+                a_pchSrc += cchCopied;
+                a_cchSrc -= cchCopied;
+            }
+            return cchWritten;
+        }
+
+    public:
+        int_type sputc(char_type a_ch)
+        {
+            if (m_offPutNext < m_cchPut)
+            {
+                m_pachPut[m_offPutNext++] = a_ch;
+                return traits_type::to_int_type(a_ch);
+            }
+            return overflow(traits_type::to_int_type(a_ch));
+        }
+
+        std::streamsize sputn(char_type const *a_pchSrc, std::streamsize a_cchSrc)
+        {
+            AssertReturn(a_cchSrc >= 0, 0);
+            return xsputn(a_pchSrc, a_cchSrc);
+        }
+
+        /** @} */
+
+        /** @todo add the remaining members... */
     };
 
@@ -306,12 +413,13 @@
     protected:
         basic_streambuf<a_CharType, a_CharTraits>  *m_pBuf;
-
-    protected:
-        void init(const std::basic_streambuf<a_CharType, a_CharTraits> *a_pBuf)
+        basic_ostream<a_CharType, a_CharTraits>    *m_pTiedStream;
+
+    protected:
+        void init(std::basic_streambuf<a_CharType, a_CharTraits> *a_pBuf)
         {
             m_pBuf         = a_pBuf;
             m_cWidth       = 0;
             m_cPrecision   = 6;
-            m_fFlags       = ios_base::dec | ios_base::wskip;
+            m_fFlags       = ios_base::dec | ios_base::skipws;
             m_fState       = ios_base::goodbit;
         }
@@ -319,14 +427,16 @@
     public:
         basic_ios()
-            : m_pBuf(NULL)
-            , ios_base()
-        {
-        }
-
-        basic_ios(const std::basic_streambuf<a_CharType, a_CharTraits> *a_pBuf)
-            : m_pBuf(NULL)
-            , ios_base()
-        {
-            init(a_pBuf)
+            : ios_base()
+            , m_pBuf(NULL)
+            , m_pTiedStream(NULL)
+        {
+        }
+
+        basic_ios(std::basic_streambuf<a_CharType, a_CharTraits> *a_pBuf)
+            : ios_base()
+            , m_pBuf(NULL)
+            , m_pTiedStream(NULL)
+        {
+            init(a_pBuf);
         }
     private:
@@ -384,4 +494,16 @@
             return pOldBuf;
         }
+
+        std::basic_ostream<a_CharType, a_CharTraits> *tie() const
+        {
+            return m_pTiedStream;
+        }
+
+        std::basic_ostream<a_CharType, a_CharTraits> tie(std::basic_ostream<a_CharType, a_CharTraits> *a_pNew) const RT_NOEXCEPT
+        {
+            std::basic_ostream<a_CharType, a_CharTraits> * const pOld = m_pTiedStream;
+            m_pTiedStream = a_pNew;
+            return pOld;
+        }
         /** @}  */
 
Index: trunk/include/iprt/nocrt/iosfwd
===================================================================
--- trunk/include/iprt/nocrt/iosfwd	(revision 95985)
+++ trunk/include/iprt/nocrt/iosfwd	(revision 95993)
@@ -49,4 +49,7 @@
     template<typename a_CharType, typename a_CharTraits = std::char_traits<a_CharType> > class basic_ostream;
     template<typename a_CharType, typename a_CharTraits = std::char_traits<a_CharType> > class basic_iostream;
+    template<typename a_CharType, typename a_CharTraits = std::char_traits<a_CharType> > class basic_ifstream;
+    template<typename a_CharType, typename a_CharTraits = std::char_traits<a_CharType> > class basic_ofstream;
+    template<typename a_CharType, typename a_CharTraits = std::char_traits<a_CharType> > class basic_fstream;
 
 
@@ -56,4 +59,7 @@
     typedef basic_ostream<char>         ostream;
     typedef basic_iostream<char>        iostream;
+    typedef basic_ifstream<char>        ifstream;
+    typedef basic_ofstream<char>        ofstream;
+    typedef basic_fstream<char>         fstream;
 }
 
Index: trunk/include/iprt/nocrt/iostream
===================================================================
--- trunk/include/iprt/nocrt/iostream	(revision 95993)
+++ trunk/include/iprt/nocrt/iostream	(revision 95993)
@@ -0,0 +1,43 @@
+/** @file
+ * IPRT / No-CRT - Minimal C++ iostream header.
+ */
+
+/*
+ * Copyright (C) 2022 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ *
+ * The contents of this file may alternatively be used under the terms
+ * of the Common Development and Distribution License Version 1.0
+ * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
+ * VirtualBox OSE distribution, in which case the provisions of the
+ * CDDL are applicable instead of those of the GPL.
+ *
+ * You may elect to license modified versions of this file under the
+ * terms and conditions of either the GPL or the CDDL or both.
+ */
+
+#ifndef IPRT_INCLUDED_nocrt_iostream
+#define IPRT_INCLUDED_nocrt_iostream
+#ifndef RT_WITHOUT_PRAGMA_ONCE
+# pragma once
+#endif
+
+#include <iprt/nocrt/iosfwd>
+
+namespace std
+{
+    extern istream cin;
+    extern ostream cout;
+    extern ostream cerr;
+    extern ostream clog; /**< buffered cerr */
+}
+
+#endif /* !IPRT_INCLUDED_nocrt_iostream */
+
Index: trunk/include/iprt/nocrt/limits
===================================================================
--- trunk/include/iprt/nocrt/limits	(revision 95993)
+++ trunk/include/iprt/nocrt/limits	(revision 95993)
@@ -0,0 +1,483 @@
+/** @file
+ * IPRT / No-CRT - C++ limits header.
+ */
+
+/*
+ * Copyright (C) 2022 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ *
+ * The contents of this file may alternatively be used under the terms
+ * of the Common Development and Distribution License Version 1.0
+ * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
+ * VirtualBox OSE distribution, in which case the provisions of the
+ * CDDL are applicable instead of those of the GPL.
+ *
+ * You may elect to license modified versions of this file under the
+ * terms and conditions of either the GPL or the CDDL or both.
+ */
+
+#ifndef IPRT_INCLUDED_nocrt_limits
+#define IPRT_INCLUDED_nocrt_limits
+#ifndef RT_WITHOUT_PRAGMA_ONCE
+# pragma once
+#endif
+
+#include <iprt/nocrt/limits.h>
+
+namespace std
+{
+    enum float_denorm_style
+    {
+        denorm_indeterminate = -1,
+        denorm_absent,
+        denorm_present,
+    };
+
+    enum float_round_style
+    {
+        round_indeterminate = -1,
+        round_toward_zero,
+        round_to_nearest,
+        round_toward_infinity,
+        round_toward_neg_infinity,
+    };
+
+    struct rtNoCrtLimitNumericBase
+    {
+        static const bool is_specialized    = false;
+        static const bool is_integer        = false;
+        static const bool is_signed         = false;
+        static const bool is_exact          = false;
+        static const bool is_bounded        = false;
+
+        static const bool has_infinity      = false;
+        static const bool has_quiet_NaN     = false;
+        static const bool has_signaling_NaN = false;
+        static const bool has_denorm_loss   = false;
+        static const bool is_iec559         = false;
+        static const bool is_modulo         = false;
+        static const bool traps             = false;
+        static const bool tinyness_before   = false;
+
+        static const int digits             = 0;
+        static const int digits10           = 0;
+        static const int max_digits10       = 0;
+        static const int radix              = 0;
+        static const int min_exponent       = 0;
+        static const int min_exponent10     = 0;
+        static const int max_exponent       = 0;
+        static const int max_exponent10     = 0;
+
+        static const float_denorm_style has_denorm = denorm_absent;
+        static const float_round_style round_style = round_toward_zero;
+    };
+
+    struct rtNoCrtLimitNumericIntBase : public rtNoCrtLimitNumericBase
+    {
+        static const bool is_specialized    = true;
+        static const bool is_integer        = true;
+        static const bool is_exact          = true;
+        static const bool is_bounded        = true;
+        static const int radix              = 2;
+    };
+
+    struct rtNoCrtLimitNumericFloatBase : public rtNoCrtLimitNumericBase
+    {
+        static const bool is_specialized    = true;
+        static const bool is_signed         = true;
+        static const bool is_bounded        = true;
+        static const bool has_infinity      = false;
+        static const bool has_quiet_NaN     = false;
+        static const bool has_signaling_NaN = false;
+        static const bool is_iec559         = false;
+        static const int radix              = FLT_RADIX;
+        static const float_denorm_style has_denorm = denorm_present;
+        static const float_round_style round_style = round_to_nearest;
+    };
+
+    /*
+     * Generic template.
+     */
+    template<typename a_Type>
+    struct numeric_limits : public rtNoCrtLimitNumericBase
+    {
+        /** @todo need a RT_CONSTEXPR_FN etc   */
+        static constexpr a_Type(min)() RT_NOEXCEPT          { return a_Type(); }
+        static constexpr a_Type(max)() RT_NOEXCEPT          { return a_Type(); }
+        static constexpr a_Type lowest() RT_NOEXCEPT        { return a_Type(); }
+        static constexpr a_Type epsilon() RT_NOEXCEPT       { return a_Type(); }
+        static constexpr a_Type round_error() RT_NOEXCEPT   { return a_Type(); }
+        static constexpr a_Type infinity() RT_NOEXCEPT      { return a_Type(); }
+        static constexpr a_Type quiet_NaN() RT_NOEXCEPT     { return a_Type(); }
+        static constexpr a_Type signaling_NaN() RT_NOEXCEPT { return a_Type(); }
+        static constexpr a_Type denorm_min() RT_NOEXCEPT    { return a_Type(); }
+    };
+
+    /* const and volatile trickery:  */
+    template<typename a_Type> struct numeric_limits<const a_Type>          : public numeric_limits<a_Type> {};
+    template<typename a_Type> struct numeric_limits<volatile a_Type>       : public numeric_limits<a_Type> {};
+    template<typename a_Type> struct numeric_limits<const volatile a_Type> : public numeric_limits<a_Type> {};
+
+    /*
+     * Integer specializations.
+     */
+    template<>
+    struct numeric_limits<bool> : public rtNoCrtLimitNumericIntBase
+    {
+        static constexpr bool(min)() RT_NOEXCEPT          { return false; }
+        static constexpr bool(max)() RT_NOEXCEPT          { return true; }
+        static constexpr bool lowest() RT_NOEXCEPT        { return false; }
+        static constexpr bool epsilon() RT_NOEXCEPT       { return false; }
+        static constexpr bool round_error() RT_NOEXCEPT   { return false; }
+        static constexpr bool infinity() RT_NOEXCEPT      { return false; }
+        static constexpr bool quiet_NaN() RT_NOEXCEPT     { return false; }
+        static constexpr bool signaling_NaN() RT_NOEXCEPT { return false; }
+        static constexpr bool denorm_min() RT_NOEXCEPT    { return false; }
+        static const int digits             = 1;
+    };
+
+    template<>
+    struct numeric_limits<char> : public rtNoCrtLimitNumericIntBase
+    {
+        static constexpr char(min)() RT_NOEXCEPT          { return CHAR_MIN; }
+        static constexpr char(max)() RT_NOEXCEPT          { return CHAR_MAX; }
+        static constexpr char lowest() RT_NOEXCEPT        { return CHAR_MIN; }
+        static constexpr char epsilon() RT_NOEXCEPT       { return 0; }
+        static constexpr char round_error() RT_NOEXCEPT   { return 0; }
+        static constexpr char infinity() RT_NOEXCEPT      { return 0; }
+        static constexpr char quiet_NaN() RT_NOEXCEPT     { return 0; }
+        static constexpr char signaling_NaN() RT_NOEXCEPT { return 0; }
+        static constexpr char denorm_min() RT_NOEXCEPT    { return 0; }
+
+        static const bool is_signed         = (char)(-1) < 0;
+        static const bool is_modulo         = (char)(-1) > 0;
+        static const int digits             = (char)(-1) < 0 ? CHAR_BIT - 1 : CHAR_BIT;
+        static const int digits10           = 2;
+    };
+
+    template<>
+    struct numeric_limits<signed char> : public rtNoCrtLimitNumericIntBase
+    {
+        static constexpr signed char(min)() RT_NOEXCEPT          { return SCHAR_MIN; }
+        static constexpr signed char(max)() RT_NOEXCEPT          { return SCHAR_MAX; }
+        static constexpr signed char lowest() RT_NOEXCEPT        { return SCHAR_MIN; }
+        static constexpr signed char epsilon() RT_NOEXCEPT       { return 0; }
+        static constexpr signed char round_error() RT_NOEXCEPT   { return 0; }
+        static constexpr signed char infinity() RT_NOEXCEPT      { return 0; }
+        static constexpr signed char quiet_NaN() RT_NOEXCEPT     { return 0; }
+        static constexpr signed char signaling_NaN() RT_NOEXCEPT { return 0; }
+        static constexpr signed char denorm_min() RT_NOEXCEPT    { return 0; }
+
+        static const bool is_signed         = true;
+        static const int digits             = CHAR_BIT - 1;
+        static const int digits10           = 2;
+    };
+
+    template<>
+    struct numeric_limits<unsigned char> : public rtNoCrtLimitNumericIntBase
+    {
+        static constexpr unsigned char(min)() RT_NOEXCEPT          { return 0; }
+        static constexpr unsigned char(max)() RT_NOEXCEPT          { return UCHAR_MAX; }
+        static constexpr unsigned char lowest() RT_NOEXCEPT        { return 0; }
+        static constexpr unsigned char epsilon() RT_NOEXCEPT       { return 0; }
+        static constexpr unsigned char round_error() RT_NOEXCEPT   { return 0; }
+        static constexpr unsigned char infinity() RT_NOEXCEPT      { return 0; }
+        static constexpr unsigned char quiet_NaN() RT_NOEXCEPT     { return 0; }
+        static constexpr unsigned char signaling_NaN() RT_NOEXCEPT { return 0; }
+        static constexpr unsigned char denorm_min() RT_NOEXCEPT    { return 0; }
+
+        static const bool is_modulo         = true;
+        static const int digits             = CHAR_BIT;
+        static const int digits10           = 2;
+    };
+
+    /** @todo wchar_t, char8_t, char16_t, char32_t   */
+
+    template<>
+    struct numeric_limits<short> : public rtNoCrtLimitNumericIntBase
+    {
+        static constexpr short(min)() RT_NOEXCEPT          { return SHRT_MIN; }
+        static constexpr short(max)() RT_NOEXCEPT          { return SHRT_MAX; }
+        static constexpr short lowest() RT_NOEXCEPT        { return SHRT_MIN; }
+        static constexpr short epsilon() RT_NOEXCEPT       { return 0; }
+        static constexpr short round_error() RT_NOEXCEPT   { return 0; }
+        static constexpr short infinity() RT_NOEXCEPT      { return 0; }
+        static constexpr short quiet_NaN() RT_NOEXCEPT     { return 0; }
+        static constexpr short signaling_NaN() RT_NOEXCEPT { return 0; }
+        static constexpr short denorm_min() RT_NOEXCEPT    { return 0; }
+
+        static const bool is_signed         = true;
+        static const int digits             = CHAR_BIT * sizeof(short) - 1;
+        static const int digits10           = 4;
+    };
+
+    template<>
+    struct numeric_limits<unsigned short> : public rtNoCrtLimitNumericIntBase
+    {
+        static constexpr unsigned short(min)() RT_NOEXCEPT          { return 0; }
+        static constexpr unsigned short(max)() RT_NOEXCEPT          { return USHRT_MAX; }
+        static constexpr unsigned short lowest() RT_NOEXCEPT        { return 0; }
+        static constexpr unsigned short epsilon() RT_NOEXCEPT       { return 0; }
+        static constexpr unsigned short round_error() RT_NOEXCEPT   { return 0; }
+        static constexpr unsigned short infinity() RT_NOEXCEPT      { return 0; }
+        static constexpr unsigned short quiet_NaN() RT_NOEXCEPT     { return 0; }
+        static constexpr unsigned short signaling_NaN() RT_NOEXCEPT { return 0; }
+        static constexpr unsigned short denorm_min() RT_NOEXCEPT    { return 0; }
+
+        static const bool is_modulo         = true;
+        static const int digits             = CHAR_BIT * sizeof(unsigned short);
+        static const int digits10           = 4;
+    };
+
+# if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED)
+    template<>
+    struct numeric_limits<wchar_t> : public rtNoCrtLimitNumericIntBase
+    {
+        static constexpr wchar_t(min)() RT_NOEXCEPT          { return WCHAR_MIN; }
+        static constexpr wchar_t(max)() RT_NOEXCEPT          { return WCHAR_MAX; }
+        static constexpr wchar_t lowest() RT_NOEXCEPT        { return WCHAR_MIN; }
+        static constexpr wchar_t epsilon() RT_NOEXCEPT       { return 0; }
+        static constexpr wchar_t round_error() RT_NOEXCEPT   { return 0; }
+        static constexpr wchar_t infinity() RT_NOEXCEPT      { return 0; }
+        static constexpr wchar_t quiet_NaN() RT_NOEXCEPT     { return 0; }
+        static constexpr wchar_t signaling_NaN() RT_NOEXCEPT { return 0; }
+        static constexpr wchar_t denorm_min() RT_NOEXCEPT    { return 0; }
+
+        static const bool is_modulo         = true;
+        static const int digits             = CHAR_BIT * sizeof(wchar_t);
+        static const int digits10           = sizeof(wchar_t) == 2 ? 4 : 9; /** @todo ASSUMES wchar_t is either 16 or 32 bits */
+    };
+# endif
+
+    template<>
+    struct numeric_limits<char16_t> : public rtNoCrtLimitNumericIntBase
+    {
+        static constexpr char16_t(min)() RT_NOEXCEPT          { return 0; }
+        static constexpr char16_t(max)() RT_NOEXCEPT          { return USHRT_MAX; }
+        static constexpr char16_t lowest() RT_NOEXCEPT        { return 0; }
+        static constexpr char16_t epsilon() RT_NOEXCEPT       { return 0; }
+        static constexpr char16_t round_error() RT_NOEXCEPT   { return 0; }
+        static constexpr char16_t infinity() RT_NOEXCEPT      { return 0; }
+        static constexpr char16_t quiet_NaN() RT_NOEXCEPT     { return 0; }
+        static constexpr char16_t signaling_NaN() RT_NOEXCEPT { return 0; }
+        static constexpr char16_t denorm_min() RT_NOEXCEPT    { return 0; }
+
+        static const bool is_modulo         = true;
+        static const int digits             = CHAR_BIT * sizeof(char16_t);
+        static const int digits10           = 4;
+    };
+
+    template<>
+    struct numeric_limits<int> : public rtNoCrtLimitNumericIntBase
+    {
+        static constexpr int(min)() RT_NOEXCEPT          { return INT_MIN; }
+        static constexpr int(max)() RT_NOEXCEPT          { return INT_MAX; }
+        static constexpr int lowest() RT_NOEXCEPT        { return INT_MIN; }
+        static constexpr int epsilon() RT_NOEXCEPT       { return 0; }
+        static constexpr int round_error() RT_NOEXCEPT   { return 0; }
+        static constexpr int infinity() RT_NOEXCEPT      { return 0; }
+        static constexpr int quiet_NaN() RT_NOEXCEPT     { return 0; }
+        static constexpr int signaling_NaN() RT_NOEXCEPT { return 0; }
+        static constexpr int denorm_min() RT_NOEXCEPT    { return 0; }
+
+        static const bool is_signed         = true;
+        static const int digits             = CHAR_BIT * sizeof(int) - 1;
+        static const int digits10           = 9;
+    };
+
+    template<>
+    struct numeric_limits<unsigned int> : public rtNoCrtLimitNumericIntBase
+    {
+        static constexpr unsigned int(min)() RT_NOEXCEPT          { return 0; }
+        static constexpr unsigned int(max)() RT_NOEXCEPT          { return UINT_MAX; }
+        static constexpr unsigned int lowest() RT_NOEXCEPT        { return 0; }
+        static constexpr unsigned int epsilon() RT_NOEXCEPT       { return 0; }
+        static constexpr unsigned int round_error() RT_NOEXCEPT   { return 0; }
+        static constexpr unsigned int infinity() RT_NOEXCEPT      { return 0; }
+        static constexpr unsigned int quiet_NaN() RT_NOEXCEPT     { return 0; }
+        static constexpr unsigned int signaling_NaN() RT_NOEXCEPT { return 0; }
+        static constexpr unsigned int denorm_min() RT_NOEXCEPT    { return 0; }
+
+        static const bool is_modulo         = true;
+        static const int digits             = CHAR_BIT * sizeof(unsigned int);
+        static const int digits10           = 9;
+    };
+
+    template<>
+    struct numeric_limits<char32_t> : public rtNoCrtLimitNumericIntBase
+    {
+        static constexpr char32_t(min)() RT_NOEXCEPT          { return 0; }
+        static constexpr char32_t(max)() RT_NOEXCEPT          { return UINT_MAX; }
+        static constexpr char32_t lowest() RT_NOEXCEPT        { return 0; }
+        static constexpr char32_t epsilon() RT_NOEXCEPT       { return 0; }
+        static constexpr char32_t round_error() RT_NOEXCEPT   { return 0; }
+        static constexpr char32_t infinity() RT_NOEXCEPT      { return 0; }
+        static constexpr char32_t quiet_NaN() RT_NOEXCEPT     { return 0; }
+        static constexpr char32_t signaling_NaN() RT_NOEXCEPT { return 0; }
+        static constexpr char32_t denorm_min() RT_NOEXCEPT    { return 0; }
+
+        static const bool is_modulo         = true;
+        static const int digits             = CHAR_BIT * sizeof(char32_t);
+        static const int digits10           = 9;
+    };
+
+    template<>
+    struct numeric_limits<long> : public rtNoCrtLimitNumericIntBase
+    {
+        static constexpr long(min)() RT_NOEXCEPT          { return LONG_MIN; }
+        static constexpr long(max)() RT_NOEXCEPT          { return LONG_MAX; }
+        static constexpr long lowest() RT_NOEXCEPT        { return LONG_MIN; }
+        static constexpr long epsilon() RT_NOEXCEPT       { return 0; }
+        static constexpr long round_error() RT_NOEXCEPT   { return 0; }
+        static constexpr long infinity() RT_NOEXCEPT      { return 0; }
+        static constexpr long quiet_NaN() RT_NOEXCEPT     { return 0; }
+        static constexpr long signaling_NaN() RT_NOEXCEPT { return 0; }
+        static constexpr long denorm_min() RT_NOEXCEPT    { return 0; }
+
+        static const bool is_signed         = true;
+        static const int digits             = CHAR_BIT * sizeof(long) - 1;
+        static const int digits10           = sizeof(long) == sizeof(int) ? 9 : 18;
+    };
+
+    template<>
+    struct numeric_limits<unsigned long> : public rtNoCrtLimitNumericIntBase
+    {
+        static constexpr unsigned long(min)() RT_NOEXCEPT          { return 0; }
+        static constexpr unsigned long(max)() RT_NOEXCEPT          { return ULONG_MAX; }
+        static constexpr unsigned long lowest() RT_NOEXCEPT        { return 0; }
+        static constexpr unsigned long epsilon() RT_NOEXCEPT       { return 0; }
+        static constexpr unsigned long round_error() RT_NOEXCEPT   { return 0; }
+        static constexpr unsigned long infinity() RT_NOEXCEPT      { return 0; }
+        static constexpr unsigned long quiet_NaN() RT_NOEXCEPT     { return 0; }
+        static constexpr unsigned long signaling_NaN() RT_NOEXCEPT { return 0; }
+        static constexpr unsigned long denorm_min() RT_NOEXCEPT    { return 0; }
+
+        static const bool is_modulo         = true;
+        static const int digits             = CHAR_BIT * sizeof(unsigned long);
+        static const int digits10           = sizeof(unsigned long) == sizeof(unsigned int) ? 9 : 19;
+    };
+
+    template<>
+    struct numeric_limits<long long> : public rtNoCrtLimitNumericIntBase
+    {
+        static constexpr long long(min)() RT_NOEXCEPT          { return LLONG_MIN; }
+        static constexpr long long(max)() RT_NOEXCEPT          { return LLONG_MAX; }
+        static constexpr long long lowest() RT_NOEXCEPT        { return LLONG_MIN; }
+        static constexpr long long epsilon() RT_NOEXCEPT       { return 0; }
+        static constexpr long long round_error() RT_NOEXCEPT   { return 0; }
+        static constexpr long long infinity() RT_NOEXCEPT      { return 0; }
+        static constexpr long long quiet_NaN() RT_NOEXCEPT     { return 0; }
+        static constexpr long long signaling_NaN() RT_NOEXCEPT { return 0; }
+        static constexpr long long denorm_min() RT_NOEXCEPT    { return 0; }
+
+        static const bool is_signed         = true;
+        static const int digits             = CHAR_BIT * sizeof(long long) - 1;
+        static const int digits10           = 18;
+    };
+
+    template<>
+    struct numeric_limits<unsigned long long> : public rtNoCrtLimitNumericIntBase
+    {
+        static constexpr unsigned long long(min)() RT_NOEXCEPT          { return 0; }
+        static constexpr unsigned long long(max)() RT_NOEXCEPT          { return ULLONG_MAX; }
+        static constexpr unsigned long long lowest() RT_NOEXCEPT        { return 0; }
+        static constexpr unsigned long long epsilon() RT_NOEXCEPT       { return 0; }
+        static constexpr unsigned long long round_error() RT_NOEXCEPT   { return 0; }
+        static constexpr unsigned long long infinity() RT_NOEXCEPT      { return 0; }
+        static constexpr unsigned long long quiet_NaN() RT_NOEXCEPT     { return 0; }
+        static constexpr unsigned long long signaling_NaN() RT_NOEXCEPT { return 0; }
+        static constexpr unsigned long long denorm_min() RT_NOEXCEPT    { return 0; }
+
+        static const bool is_modulo         = true;
+        static const int digits             = CHAR_BIT * sizeof(unsigned long long);
+        static const int digits10           = 19;
+    };
+
+
+    /*
+     * Floating point.
+     */
+    template<>
+    struct numeric_limits<float> : public rtNoCrtLimitNumericFloatBase
+    {
+        static constexpr float(min)() RT_NOEXCEPT          { return FLT_MIN; }
+        static constexpr float(max)() RT_NOEXCEPT          { return FLT_MAX; }
+        static constexpr float lowest() RT_NOEXCEPT        { return -(FLT_MAX); }
+        static constexpr float epsilon() RT_NOEXCEPT       { return FLT_EPSILON; }
+        static constexpr float round_error() RT_NOEXCEPT   { return 0.5F; }
+        static constexpr float infinity() RT_NOEXCEPT      { return __builtin_huge_valf(); }
+        static constexpr float quiet_NaN() RT_NOEXCEPT     { return __builtin_nanf("0"); }
+        static constexpr float signaling_NaN() RT_NOEXCEPT { return __builtin_nansf("1"); }
+        static constexpr float denorm_min() RT_NOEXCEPT    { return FLT_TRUE_MIN; }
+
+        static const int digits             = FLT_MANT_DIG;
+        static const int digits10           = FLT_DIG;
+        static const int max_digits10       = FLT_DECIMAL_DIG;
+        static const int max_exponent       = FLT_MAX_EXP;
+        static const int max_exponent10     = FLT_MAX_10_EXP;
+        static const int min_exponent       = FLT_MIN_EXP;
+        static const int min_exponent10     = FLT_MIN_10_EXP;
+    };
+
+    template<>
+    struct numeric_limits<double> : public rtNoCrtLimitNumericFloatBase
+    {
+        static constexpr double(min)() RT_NOEXCEPT          { return DBL_MIN; }
+        static constexpr double(max)() RT_NOEXCEPT          { return DBL_MAX; }
+        static constexpr double lowest() RT_NOEXCEPT        { return -(DBL_MAX); }
+        static constexpr double epsilon() RT_NOEXCEPT       { return DBL_EPSILON; }
+        static constexpr double round_error() RT_NOEXCEPT   { return 0.5; }
+        static constexpr double infinity() RT_NOEXCEPT      { return __builtin_huge_val(); }
+        static constexpr double quiet_NaN() RT_NOEXCEPT     { return __builtin_nan("0"); }
+        static constexpr double signaling_NaN() RT_NOEXCEPT { return __builtin_nans("1"); }
+        static constexpr double denorm_min() RT_NOEXCEPT    { return DBL_TRUE_MIN; }
+
+        static const int digits             = DBL_MANT_DIG;
+        static const int digits10           = DBL_DIG;
+        static const int max_digits10       = DBL_DECIMAL_DIG;
+        static const int max_exponent       = DBL_MAX_EXP;
+        static const int max_exponent10     = DBL_MAX_10_EXP;
+        static const int min_exponent       = DBL_MIN_EXP;
+        static const int min_exponent10     = DBL_MIN_10_EXP;
+    };
+
+    template<>
+    struct numeric_limits<long double> : public rtNoCrtLimitNumericFloatBase
+    {
+        static constexpr long double(min)() RT_NOEXCEPT          { return LDBL_MIN; }
+        static constexpr long double(max)() RT_NOEXCEPT          { return LDBL_MAX; }
+        static constexpr long double lowest() RT_NOEXCEPT        { return -(LDBL_MAX); }
+        static constexpr long double epsilon() RT_NOEXCEPT       { return LDBL_EPSILON; }
+        static constexpr long double round_error() RT_NOEXCEPT   { return 0.5L; }
+#if LDBL_DIG == DBL_DIG
+        static constexpr long double infinity() RT_NOEXCEPT      { return __builtin_huge_val(); }
+        static constexpr long double quiet_NaN() RT_NOEXCEPT     { return __builtin_nan("0"); }
+        static constexpr long double signaling_NaN() RT_NOEXCEPT { return __builtin_nans("1"); }
+#else
+        static constexpr long double infinity() RT_NOEXCEPT      { return __builtin_huge_vall(); }
+        static constexpr long double quiet_NaN() RT_NOEXCEPT     { return __builtin_nanl("0"); }
+        static constexpr long double signaling_NaN() RT_NOEXCEPT { return __builtin_nansl("1"); }
+#endif
+        static constexpr long double denorm_min() RT_NOEXCEPT    { return LDBL_TRUE_MIN; }
+
+        static const int digits             = LDBL_MANT_DIG;
+        static const int digits10           = LDBL_DIG;
+        static const int max_digits10       = LDBL_DECIMAL_DIG;
+        static const int max_exponent       = LDBL_MAX_EXP;
+        static const int max_exponent10     = LDBL_MAX_10_EXP;
+        static const int min_exponent       = LDBL_MIN_EXP;
+        static const int min_exponent10     = LDBL_MIN_10_EXP;
+    };
+
+    /** @todo  more types  */
+}
+
+#endif /* !IPRT_INCLUDED_nocrt_limits */
+
Index: trunk/include/iprt/nocrt/memory
===================================================================
--- trunk/include/iprt/nocrt/memory	(revision 95985)
+++ trunk/include/iprt/nocrt/memory	(revision 95993)
@@ -91,4 +91,6 @@
         }
     };
+
+    /** @todo make_unique and unique   */
 }
 
Index: trunk/include/iprt/nocrt/ostream
===================================================================
--- trunk/include/iprt/nocrt/ostream	(revision 95985)
+++ trunk/include/iprt/nocrt/ostream	(revision 95993)
@@ -41,4 +41,42 @@
     class basic_ostream : public basic_ios<a_CharType, a_CharTraits>
     {
+    protected:
+        /** Sentry class that performs pre and post output work. */
+        class sentry
+        {
+        private:
+            basic_ostream &m_rParent;
+
+        public:
+            explicit sentry(basic_ostream &a_rParent)
+                : m_rParent(a_rParent)
+            {
+                if (a_rParent.good())
+                {
+                    basic_ostream *pTiedStream = a_rParent.tie();
+                    if (!pTiedStream)
+                    { /* likely? */ }
+                    else
+                    {
+                        pTiedStream->flush();
+                        if (!pTiedStream->good())
+                            a_rParent.setstate(failbit);
+                    }
+                }
+            }
+
+            explicit operator bool() const
+            {
+                return m_rParent.good();
+            }
+
+            ~sentry()
+            {
+                if (   (m_rParent.flags() & std::ios_base::unitbuf)
+                    && m_rParent.good())
+                    m_rParent.rdbuf()->pubsync();
+            }
+        };
+
     public:
         explicit basic_ostream(std::basic_streambuf<a_CharType,a_CharTraits> *a_pBuf)
@@ -55,6 +93,27 @@
 
     public:
-        basic_ostream &put(char_type a_ch);
-        basic_ostream &write(const char_type *a_pchSrc, std::streamsize a_cchToWrite);
+        basic_ostream &put(char_type a_ch)
+        {
+            sentry PrePost(*this);
+            if (PrePost)
+            {
+                if (m_pBuf->sputc(a_ch) == traits_type::eof())
+                    m_fState |= badbit;
+            }
+            return *this;
+        }
+
+        basic_ostream &write(const char_type *a_pchSrc, std::streamsize a_cchToWrite)
+        {
+            sentry PrePost(*this);
+            if (PrePost)
+            {
+                std::streamsize cchWritten = m_pBuf->sputn(a_pchSrc, a_cchToWrite);
+                if (cchWritten != a_cchToWrite)
+                    m_fState |= badbit;
+            }
+            return *this;
+        }
+
         basic_ostream &flush();
         pos_type       tellp() RT_NOEXCEPT;
@@ -91,9 +150,9 @@
         }
 
-        basic_ostream &formatInteger(uint64_t a_uValue, uint32_t fFlags)
-        {
-            fFlags |= intGetIntegerFlags();
+        basic_ostream &formatInteger(uint64_t a_uValue, uint32_t a_fFlags, unsigned a_uBase = 0)
+        {
+            a_fFlags |= intGetIntegerFlags();
             char szTmp[72];
-            int  cchTmp = RTStrFormatNumber(szTmp, a_uValue, intGetIntegerBase(), 0, 0, fFlags);
+            int  cchTmp = RTStrFormatNumber(szTmp, a_uValue, !a_uBase ? intGetIntegerBase() : a_uBase, 0, 0, a_fFlags);
 
             /** @todo apply cchWidth and padding.  */
@@ -171,6 +230,20 @@
                                     RTSTR_F_VALSIGNED | (sizeof(a_uValue) > sizeof(uint32_t) ? RTSTR_F_64BIT : RTSTR_F_32BIT));
     }
+
+    template<typename a_CharType, typename a_CharTraits = std::char_traits<a_CharType> >
+    basic_ostream<a_CharType, a_CharTraits> &operator<<(basic_ostream<a_CharType, a_CharTraits> &a_rDst, void const *a_pvValue)
+    {
+        return a_rDst.formatInteger((uintptr_t)a_pvValue,
+                                    (sizeof(a_pvValue) > sizeof(uint32_t) ? RTSTR_F_64BIT : RTSTR_F_32BIT), 16);
+    }
     /** @} */
 
+    template<>
+    basic_ostream<char> &basic_ostream<char>::intWrite(const char *a_pchSrc, std::streamsize a_cchToWrite)
+    {
+        return write(a_pchSrc, a_cchToWrite);
+    }
+
+
 }
 
