PHP 8.3.31
Preview: traits.hpp Size: 4.11 KB
/opt/cpanel/ea-ruby27/src/passenger-release-6.1.2/src/cxx_supportlib/vendor-modified/boost/random/traits.hpp

/* boost random/traits.hpp header file
 *
 * Copyright John Maddock 2015
 * Distributed under 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)
 *
 * See http://www.boost.org for most recent version including documentation.
 *
 * These traits classes serve two purposes: they are designed to mostly
 * work out of the box for multiprecision types (ie number types that are
 * C++ class types and not integers or floats from type-traits point of view),
 * they are also a potential point of specialization for user-defined
 * number types.
 *
 * $Id$
 */

#ifndef BOOST_RANDOM_TRAITS_HPP
#define BOOST_RANDOM_TRAITS_HPP

#include <boost/type_traits/integral_constant.hpp>
#include <boost/type_traits/is_signed.hpp>
#include <boost/type_traits/is_integral.hpp>
#include <boost/type_traits/make_unsigned.hpp>
#include <limits>

namespace boost {
namespace random {
namespace traits {
   // \cond show_private
   template <class T, bool intrinsic>
   struct make_unsigned_imp
   {
      typedef typename boost::make_unsigned<T>::type type;
   };
   template <class T>
   struct make_unsigned_imp<T, false>
   {
      BOOST_STATIC_ASSERT(std::numeric_limits<T>::is_specialized);
      BOOST_STATIC_ASSERT(std::numeric_limits<T>::is_signed == false);
      BOOST_STATIC_ASSERT(std::numeric_limits<T>::is_integer == true);
      typedef T type;
   };
   // \endcond
   /** \brief Converts the argument type T to an unsigned type.
   *
   * This trait has a single member `type` which is the unsigned type corresponding to T.
   * Note that
   * if T is signed, then member `type` *should define a type with one more bit precision than T*.  For built-in
   * types this trait defaults to `boost::make_unsigned<T>::type`.  For user defined types it simply asserts that
   * the argument type T is an unsigned integer (using std::numeric_limits).
   * User defined specializations may be provided for other cases.
   */
   template <class T>
   struct make_unsigned
   // \cond show_private
      : public make_unsigned_imp < T, boost::is_integral<T>::value > 
      // \endcond
   {};
   // \cond show_private
   template <class T, bool intrinsic>
   struct make_unsigned_or_unbounded_imp
   {
      typedef typename boost::make_unsigned<T>::type type;
   };
   template <class T>
   struct make_unsigned_or_unbounded_imp<T, false>
   {
      BOOST_STATIC_ASSERT(std::numeric_limits<T>::is_specialized);
      BOOST_STATIC_ASSERT((std::numeric_limits<T>::is_signed == false) || (std::numeric_limits<T>::is_bounded == false));
      BOOST_STATIC_ASSERT(std::numeric_limits<T>::is_integer == true);
      typedef T type;
   };
   // \endcond
   /** \brief Converts the argument type T to either an unsigned type or an unbounded integer type.
   *
   * This trait has a single member `type` which is either the unsigned type corresponding to T or an unbounded
   * integer type.  This trait is used to generate types suitable for the calculation of a range: as a result
   * if T is signed, then member `type` *should define a type with one more bit precision than T*.  For built-in
   * types this trait defaults to `boost::make_unsigned<T>::type`.  For user defined types it simply asserts that
   * the argument type T is either an unbounded integer, or an unsigned one (using std::numeric_limits).
   * User defined specializations may be provided for other cases.
   */
   template <class T>
   struct make_unsigned_or_unbounded
      // \cond show_private
      : public make_unsigned_or_unbounded_imp < T, boost::is_integral<T>::value > 
      // \endcond
   {};
   /** \brief Traits class that indicates whether type T is an integer
   */
   template <class T>
   struct is_integral
      : public integral_constant<bool, boost::is_integral<T>::value || (std::numeric_limits<T>::is_integer)>
   {};
   /** \brief Traits class that indicates whether type T is a signed integer
   */
   template <class T> struct is_signed
      : public integral_constant<bool, boost::is_signed<T>::value || (std::numeric_limits<T>::is_specialized && std::numeric_limits<T>::is_integer && std::numeric_limits<T>::is_signed)>
   {};

}
}
}

#endif

Directory Contents

Dirs: 1 × Files: 58

Name Size Perms Modified Actions
detail DIR
- drwxr-xr-x 2026-02-11 07:32:10
Edit Download
8.65 KB lrw-r--r-- 2026-01-27 23:50:52
Edit Download
5.48 KB lrw-r--r-- 2026-01-27 23:50:52
Edit Download
5.98 KB lrw-r--r-- 2026-01-27 23:50:52
Edit Download
12.68 KB lrw-r--r-- 2026-01-27 23:50:52
Edit Download
6.38 KB lrw-r--r-- 2026-01-27 23:50:52
Edit Download
6.17 KB lrw-r--r-- 2026-01-27 23:50:52
Edit Download
7.83 KB lrw-r--r-- 2026-01-27 23:50:52
Edit Download
20.54 KB lrw-r--r-- 2026-01-27 23:50:52
Edit Download
20.41 KB lrw-r--r-- 2026-01-27 23:50:52
Edit Download
5.48 KB lrw-r--r-- 2026-01-27 23:50:52
Edit Download
11.21 KB lrw-r--r-- 2026-01-27 23:50:52
Edit Download
5.79 KB lrw-r--r-- 2026-01-27 23:50:52
Edit Download
8.96 KB lrw-r--r-- 2026-01-27 23:50:52
Edit Download
10.22 KB lrw-r--r-- 2026-01-27 23:50:52
Edit Download
2.85 KB lrw-r--r-- 2026-01-27 23:50:52
Edit Download
7.17 KB lrw-r--r-- 2026-01-27 23:50:52
Edit Download
36.12 KB lrw-r--r-- 2026-01-27 23:50:52
Edit Download
8.95 KB lrw-r--r-- 2026-01-27 23:50:52
Edit Download
6.81 KB lrw-r--r-- 2026-01-27 23:50:52
Edit Download
9.30 KB lrw-r--r-- 2026-01-27 23:50:52
Edit Download
17.89 KB lrw-r--r-- 2026-01-27 23:50:52
Edit Download
5.61 KB lrw-r--r-- 2026-01-27 23:50:52
Edit Download
15.82 KB lrw-r--r-- 2026-01-27 23:50:52
Edit Download
7.04 KB lrw-r--r-- 2026-01-27 23:50:52
Edit Download
7.86 KB lrw-r--r-- 2026-01-27 23:50:52
Edit Download
23.48 KB lrw-r--r-- 2026-01-27 23:50:52
Edit Download
13.56 KB lrw-r--r-- 2026-01-27 23:50:52
Edit Download
6.75 KB lrw-r--r-- 2026-01-27 23:50:52
Edit Download
11.46 KB lrw-r--r-- 2026-01-27 23:50:52
Edit Download
7.54 KB lrw-r--r-- 2026-01-27 23:50:52
Edit Download
17.03 KB lrw-r--r-- 2026-01-27 23:50:52
Edit Download
16.69 KB lrw-r--r-- 2026-01-27 23:50:52
Edit Download
18.26 KB lrw-r--r-- 2026-01-27 23:50:52
Edit Download
9.91 KB lrw-r--r-- 2026-01-27 23:50:52
Edit Download
4.95 KB lrw-r--r-- 2026-01-27 23:50:52
Edit Download
1.91 KB lrw-r--r-- 2026-01-27 23:50:52
Edit Download
3.21 KB lrw-r--r-- 2026-01-27 23:50:52
Edit Download
3.64 KB lrw-r--r-- 2026-01-27 23:50:52
Edit Download
9.00 KB lrw-r--r-- 2026-01-27 23:50:52
Edit Download
1.32 KB lrw-r--r-- 2026-01-27 23:50:52
Edit Download
7.55 KB lrw-r--r-- 2026-01-27 23:50:52
Edit Download
5.53 KB lrw-r--r-- 2026-01-27 23:50:52
Edit Download
5.50 KB lrw-r--r-- 2026-01-27 23:50:52
Edit Download
21.16 KB lrw-r--r-- 2026-01-27 23:50:52
Edit Download
1.14 KB lrw-r--r-- 2026-01-27 23:50:52
Edit Download
4.11 KB lrw-r--r-- 2026-01-27 23:50:52
Edit Download
6.87 KB lrw-r--r-- 2026-01-27 23:50:52
Edit Download
7.36 KB lrw-r--r-- 2026-01-27 23:50:52
Edit Download
2.84 KB lrw-r--r-- 2026-01-27 23:50:52
Edit Download
15.85 KB lrw-r--r-- 2026-01-27 23:50:52
Edit Download
8.61 KB lrw-r--r-- 2026-01-27 23:50:52
Edit Download
2.39 KB lrw-r--r-- 2026-01-27 23:50:52
Edit Download
7.51 KB lrw-r--r-- 2026-01-27 23:50:52
Edit Download
11.93 KB lrw-r--r-- 2026-01-27 23:50:52
Edit Download
3.62 KB lrw-r--r-- 2026-01-27 23:50:52
Edit Download
5.39 KB lrw-r--r-- 2026-01-27 23:50:52
Edit Download
6.96 KB lrw-r--r-- 2026-01-27 23:50:52
Edit Download
13.55 KB lrw-r--r-- 2026-01-27 23:50:52
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).