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
5631  {
5632  // An instance of the type predicate returns the value if the type _DataType is one of the integral types, otherwise it
5633  // statically asserts.
5634  // An integral type is one of: bool, char, unsigned char, signed char, wchar_t, short, unsigned short, int, unsigned int, long,
5635  // and unsigned long.
5636  // In addition, with compilers that provide them, an integral type can be one of long long, unsigned long long, __int64, and
5637  // unsigned __int64
5638  static_assert(std::is_integral<_DataType>::value,
5639  "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.");
5640  static_assert((sizeof(_DataType) <= sizeof(size_t)), "Passed Type is bigger than size_t.");
5641 
5642  if (std::is_unsigned<_DataType>::value)
5643  {
5644  return _Val;
5645  }
5646  else
5647  {
5648  // The default function needs to take the signed integer-like representation and map it to an unsigned one. The
5649  // following code will take the midpoint of the unsigned representable range (SIZE_MAX/2)+1 and does an unsigned
5650  // add of the value. Thus, it maps a [-signed_min,+signed_max] range into a [0, unsigned_max] range.
5651  return (((SIZE_MAX/2) + 1) + static_cast<size_t>(_Val));
5652  }
5653  }
_FwdIt const _Ty _Val
Definition: algorithm:1938
#define SIZE_MAX
Definition: limits.h:76

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