Bug 1449132 [wpt PR 10194] - [css-grid] Fix resolution of percentage paddings and...
[gecko.git] / mfbt / NullPtr.h
blobd2248f4bccc7bc20169f488c2bfa3747d42e353f
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 /* Implements a mozilla::IsNullPointer<T> type trait. */
9 #ifndef mozilla_NullPtr_h
10 #define mozilla_NullPtr_h
12 #include "mozilla/TypeTraits.h"
14 namespace mozilla {
16 /**
17 * IsNullPointer<T>::value is true iff T is decltype(nullptr).
19 * Ideally this would be in TypeTraits.h, but C++11 omitted std::is_null_pointer
20 * (fixed in C++14), so in the interests of easing a switch to <type_traits>,
21 * this trait lives elsewhere.
23 template<typename T>
24 struct IsNullPointer : FalseType {};
26 template<>
27 struct IsNullPointer<decltype(nullptr)> : TrueType {};
29 } // namespace mozilla
31 #endif /* mozilla_NullPtr_h */