BVB Source Codes

mars Show sign_mixture.hpp Source code

Return Download mars: download sign_mixture.hpp Source code - Download mars Source code - Type:.hpp
  1. //  (c) Copyright Fernando Luis Cacciola Carballal 2000-2004
  2. //  Use, modification, and distribution is subject to the Boost Software
  3. //  License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  4. //  http://www.boost.org/LICENSE_1_0.txt)
  5.  
  6. //  See library home page at http://www.boost.org/libs/numeric/conversion
  7. //
  8. // Contact the author at: fernando_cacciola@hotmail.com
  9. //
  10. #ifndef BOOST_NUMERIC_CONVERSION_DETAIL_SIGN_MIXTURE_FLC_12NOV2002_HPP
  11. #define BOOST_NUMERIC_CONVERSION_DETAIL_SIGN_MIXTURE_FLC_12NOV2002_HPP
  12.  
  13. #include "boost/config.hpp"
  14. #include "boost/limits.hpp"
  15.  
  16. #include "boost/numeric/conversion/sign_mixture_enum.hpp"
  17. #include "boost/numeric/conversion/detail/meta.hpp"
  18.  
  19. #include "boost/mpl/integral_c.hpp"
  20.  
  21. namespace mars_boost {} namespace boost = mars_boost; namespace mars_boost { namespace numeric { namespace convdetail
  22. {
  23.   // Integral Constants for 'SignMixture'
  24.   typedef mpl::integral_c<sign_mixture_enum, unsigned_to_unsigned> unsig2unsig_c ;
  25.   typedef mpl::integral_c<sign_mixture_enum, signed_to_signed>     sig2sig_c ;
  26.   typedef mpl::integral_c<sign_mixture_enum, signed_to_unsigned>   sig2unsig_c ;
  27.   typedef mpl::integral_c<sign_mixture_enum, unsigned_to_signed>   unsig2sig_c ;
  28.  
  29.   // Metafunction:
  30.   //
  31.   //   get_sign_mixture<T,S>::type
  32.   //
  33.   // Selects the appropriate SignMixture Integral Constant for the combination T,S.
  34.   //
  35.   template<class T,class S>
  36.   struct get_sign_mixture
  37.   {
  38.     typedef mpl::bool_< ::std::numeric_limits<S>::is_signed > S_signed ;
  39.     typedef mpl::bool_< ::std::numeric_limits<T>::is_signed > T_signed ;
  40.  
  41.     typedef typename
  42.       for_both<S_signed, T_signed, sig2sig_c, sig2unsig_c, unsig2sig_c, unsig2unsig_c>::type
  43.         type ;
  44.   } ;
  45.  
  46.   // Metafunction:
  47.   //
  48.   //   for_sign_mixture<SignMixture,Sig2Sig,Sig2Unsig,Unsig2Sig,Unsig2Unsig>::type
  49.   //
  50.   // {SignMixture} is one of the Integral Constants for SignMixture, declared above.
  51.   // {Sig2Sig,Sig2Unsig,Unsig2Sig,Unsig2Unsig} are aribtrary types. (not metafunctions)
  52.   //
  53.   // According to the value of 'SignMixture', selects the corresponding type.
  54.   //
  55.   template<class SignMixture, class Sig2Sig, class Sig2Unsig, class Unsig2Sig, class Unsig2Unsig>
  56.   struct for_sign_mixture
  57.   {
  58.     typedef typename
  59.       ct_switch4<SignMixture
  60.                  , sig2sig_c, sig2unsig_c, unsig2sig_c  // default
  61.                  , Sig2Sig  , Sig2Unsig  , Unsig2Sig  , Unsig2Unsig
  62.                 >::type
  63.         type ;
  64.   } ;
  65.  
  66. } } } // namespace mars_boost::numeric::convdetail
  67.  
  68. #endif
  69. //
  70. ///////////////////////////////////////////////////////////////////////////////////////////////
  71.  
  72.  
  73.  
downloadsign_mixture.hpp Source code - Download mars Source code
Related Source Codes/Software:
Hero - Elegant transition library for iOS & tvOS 2017-06-09
deep-photo-styletransfer - Code and data for paper "Deep Photo Style Transfer... 2017-06-09
mastodon - A GNU Social-compatible microblogging server ... 2017-06-09
plyr - A simple HTML5, YouTube and Vimeo player ... 2017-06-08
prepack - Prepack is a partial evaluator for JavaScript. Pre... 2017-06-08
Public-APIs - 2017-06-09
lottie-ios - An iOS library to natively render After Effects ve... 2017-06-09
Awesome-Hacking - A collection of various awesome lists for hackers,... 2017-06-09
algorithms - Minimal examples of data structures and algorithms... 2017-06-10
lectures - Oxford Deep NLP 2017 course 2017-06-10
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
postal - 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top