michael@0: /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* vim: set ts=8 sts=2 et sw=2 tw=80: */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: /* Compatibility with std::numeric_limits. */ michael@0: michael@0: #ifndef mozilla_NumericLimits_h michael@0: #define mozilla_NumericLimits_h michael@0: michael@0: #include "mozilla/Char16.h" michael@0: michael@0: #include michael@0: #include michael@0: michael@0: namespace mozilla { michael@0: michael@0: /** michael@0: * The NumericLimits class provides a compatibility layer with std::numeric_limits michael@0: * for char16_t, otherwise it is exactly the same as std::numeric_limits. michael@0: * Code which does not need std::numeric_limits should avoid using michael@0: * NumericLimits. michael@0: */ michael@0: template michael@0: class NumericLimits : public std::numeric_limits michael@0: { michael@0: }; michael@0: michael@0: #ifdef MOZ_CHAR16_IS_NOT_WCHAR michael@0: template<> michael@0: class NumericLimits : public std::numeric_limits michael@0: { michael@0: // char16_t and uint16_t numeric limits should be exactly the same. michael@0: }; michael@0: #endif michael@0: michael@0: } // namespace mozilla michael@0: michael@0: #endif /* mozilla_NumericLimits_h */