1 //===-- sanitizer_type_traits.h ---------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // Implements a subset of C++ type traits. This is so we can avoid depending
11 // on system C++ headers.
13 //===----------------------------------------------------------------------===//
14 #ifndef SANITIZER_TYPE_TRAITS_H
15 #define SANITIZER_TYPE_TRAITS_H
17 namespace __sanitizer {
20 static const bool value = true;
24 static const bool value = false;
29 // Type trait to compare if types are the same.
33 // is_same<int,int>::value - True
34 // is_same<int,char>::value - False
36 template <typename T, typename U>
37 struct is_same : public false_type {};
40 struct is_same<T, T> : public true_type {};
42 } // namespace __sanitizer