STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | List of all members
Concurrency::_Radix_sort_default_function< _DataType > Struct Template Reference

#include <ppl.h>

Public Member Functions

size_t operator() (const _DataType &_Val) const
 

Member Function Documentation

template<typename _DataType>
size_t Concurrency::_Radix_sort_default_function< _DataType >::operator() ( const _DataType &  _Val) const
inline
5628  {
5629  // An instance of the type predicate returns the value if the type _DataType is one of the integral types, otherwise it
5630  // statically asserts.
5631  // An integral type is one of: bool, char, unsigned char, signed char, wchar_t, short, unsigned short, int, unsigned int, long,
5632  // and unsigned long.
5633  // In addition, with compilers that provide them, an integral type can be one of long long, unsigned long long, __int64, and
5634  // unsigned __int64
5635  static_assert(std::is_integral<_DataType>::value,
5636  "Type should be integral to use default radix function. For more information on integral types, please refer to https://msdn.microsoft.com/en-us/library/bb983099.aspx.");
5637  static_assert((sizeof(_DataType) <= sizeof(size_t)), "Passed Type is bigger than size_t.");
5638 
5639  if (std::is_unsigned<_DataType>::value)
5640  {
5641  return _Val;
5642  }
5643  else
5644  {
5645  // The default function needs to take the signed integer-like representation and map it to an unsigned one. The
5646  // following code will take the midpoint of the unsigned representable range (SIZE_MAX/2)+1 and does an unsigned
5647  // add of the value. Thus, it maps a [-signed_min,+signed_max] range into a [0, unsigned_max] range.
5648  return (((SIZE_MAX/2) + 1) + static_cast<size_t>(_Val));
5649  }
5650  }
_In_ int _Val
Definition: vcruntime_string.h:62
#define SIZE_MAX
Definition: limits.h:76

The documentation for this struct was generated from the following file: