Squashed 'third_party/boostorg/type_traits/' content from commit 059ed88

Change-Id: I222c604dfa1db194bf53bc6aa1152fb16e83ce06
git-subtree-dir: third_party/boostorg/type_traits
git-subtree-split: 059ed8839da3fecd1e8b62cdc11be006f6346b5e
diff --git a/tools/specialisations.cpp b/tools/specialisations.cpp
new file mode 100644
index 0000000..f276bef
--- /dev/null
+++ b/tools/specialisations.cpp
@@ -0,0 +1,122 @@
+
+//  (C) Copyright John Maddock 2000. 
+//  Use, modification and distribution are subject to the 
+//  Boost Software License, Version 1.0. (See accompanying file 
+//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+//
+// Simple program to output some template specialisations for the type_traits library.
+//
+
+#include <fstream>
+
+using namespace std;
+
+unsigned specializations = 30;
+
+int main()
+{
+   unsigned i, j;
+   ofstream os("specialisations");
+
+   //
+   // generate is_function tester prototypes:
+   for(i = 0; i <= specializations; ++i)
+   {
+      os << "template <class R";
+      for(j = 0; j < i; ++j)
+      {
+         os << ", class A" << j;
+      }
+      os << ">\n::boost::type_traits::yes_type is_function_tester(R (*)(";
+      if(i == 0)
+         os << "void";
+      else
+      {
+         for(j = 0; j < i; ++j)
+         {
+            if(j) os << ", ";
+            os << "A" << j;
+         }
+      }
+      os << "));" << endl;
+   }
+   os << endl << endl;
+   //
+   // generate is_function_helper partial specialisations:
+   //
+   for(i = 0; i < specializations; ++i)
+   {
+      os << "template <class R";
+      for(j = 0; j < i; ++j)
+      {
+         os << ", class A" << j;
+      }
+      os << ">\nstruct is_function_helper_base<R (*)(";
+      if(i == 0)
+         os << "void";
+      else
+      {
+         for(j = 0; j < i; ++j)
+         {
+            if(j) os << ", ";
+            os << "A" << j;
+         }
+      }
+      os << ")>{ BOOST_STATIC_CONSTANT(bool, value = true); };" << endl;
+   }
+   os << endl << endl;
+
+
+   //
+   // generate is_member_pointer_helper tester prototypes:
+   for(i = 0; i <= specializations; ++i)
+   {
+      os << "template <class R, class T";
+      for(j = 0; j < i; ++j)
+      {
+         os << ", class A" << j;
+      }
+      os << ">\n::boost::type_traits::yes_type is_member_pointer_helper(R (T::*)(";
+      if(i == 0)
+         os << "void";
+      else
+      {
+         for(j = 0; j < i; ++j)
+         {
+            if(j) os << ", ";
+            os << "A" << j;
+         }
+      }
+      os << "));" << endl;
+   }
+   os << endl << endl;
+   //
+   // generate is_member_pointer partial specialisations:
+   //
+   for(i = 0; i < specializations; ++i)
+   {
+      os << "template <class R, class T";
+      for(j = 0; j < i; ++j)
+      {
+         os << ", class A" << j;
+      }
+      os << ">\nstruct is_member_pointer<R (T::*)(";
+      if(i == 0)
+         os << "void";
+      else
+      {
+         for(j = 0; j < i; ++j)
+         {
+            if(j) os << ", ";
+            os << "A" << j;
+         }
+      }
+      os << ")>{ BOOST_STATIC_CONSTANT(bool, value = true); };" << endl;
+   }
+   os << endl << endl;
+
+
+   return 0;
+}
+