BVB Source Codes

mars Show select.hpp Source code

Return Download mars: download select.hpp Source code - Download mars Source code - Type:.hpp
  1. // (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
  2. // (C) Copyright 2003-2007 Jonathan Turkanis
  3. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  4. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
  5.  
  6. // See http://www.boost.org/libs/iostreams for documentation.
  7.  
  8. // Contains the metafunction select, which mimics the effect of a chain of
  9. // nested mpl if_'s.
  10. //
  11. // -----------------------------------------------------------------------------
  12. //
  13. // Usage:
  14. //      
  15. // typedef typename select<
  16. //                      case1,  type1,
  17. //                      case2,  type2,
  18. //                      ...
  19. //                      true_,  typen
  20. //                  >::type selection;
  21. //
  22. // Here case1, case2, ... are models of MPL::IntegralConstant with value type
  23. // bool, and n <= 12.
  24.  
  25. #ifndef BOOST_IOSTREAMS_SELECT_HPP_INCLUDED
  26. #define BOOST_IOSTREAMS_SELECT_HPP_INCLUDED  
  27.  
  28. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  29. # pragma once
  30. #endif                  
  31.  
  32. #include <boost/type_traits/is_base_and_derived.hpp>
  33. #include <boost/mpl/eval_if.hpp>
  34. #include <boost/mpl/identity.hpp>
  35. #include <boost/mpl/if.hpp>
  36. #include <boost/mpl/void.hpp>
  37.  
  38. namespace mars_boost {} namespace boost = mars_boost; namespace mars_boost { namespace iostreams {
  39.  
  40. typedef mpl::true_ else_;
  41.  
  42. template< typename Case1 = mpl::true_,
  43.           typename Type1 = mpl::void_,
  44.           typename Case2 = mpl::true_,
  45.           typename Type2 = mpl::void_,
  46.           typename Case3 = mpl::true_,
  47.           typename Type3 = mpl::void_,
  48.           typename Case4 = mpl::true_,
  49.           typename Type4 = mpl::void_,
  50.           typename Case5 = mpl::true_,
  51.           typename Type5 = mpl::void_,
  52.           typename Case6 = mpl::true_,
  53.           typename Type6 = mpl::void_,
  54.           typename Case7 = mpl::true_,
  55.           typename Type7 = mpl::void_,
  56.           typename Case8 = mpl::true_,
  57.           typename Type8 = mpl::void_,
  58.           typename Case9 = mpl::true_,
  59.           typename Type9 = mpl::void_,
  60.           typename Case10 = mpl::true_,
  61.           typename Type10 = mpl::void_,
  62.           typename Case11 = mpl::true_,
  63.           typename Type11 = mpl::void_,
  64.           typename Case12 = mpl::true_,
  65.           typename Type12 = mpl::void_ >
  66. struct select {
  67.     typedef typename
  68.             mpl::eval_if<
  69.                 Case1, mpl::identity<Type1>, mpl::eval_if<
  70.                 Case2, mpl::identity<Type2>, mpl::eval_if<
  71.                 Case3, mpl::identity<Type3>, mpl::eval_if<
  72.                 Case4, mpl::identity<Type4>, mpl::eval_if<
  73.                 Case5, mpl::identity<Type5>, mpl::eval_if<
  74.                 Case6, mpl::identity<Type6>, mpl::eval_if<
  75.                 Case7, mpl::identity<Type7>, mpl::eval_if<
  76.                 Case8, mpl::identity<Type8>, mpl::eval_if<
  77.                 Case9, mpl::identity<Type9>, mpl::eval_if<
  78.                 Case10, mpl::identity<Type10>, mpl::eval_if<
  79.                 Case11, mpl::identity<Type11>, mpl::if_<
  80.                 Case12, Type12, mpl::void_ > > > > > > > > > > >
  81.             >::type type;
  82. };
  83.  
  84. } } // End namespaces iostreams, boost.
  85.  
  86. #endif // #ifndef BOOST_IOSTREAMS_SELECT_HPP_INCLUDED
  87.  
downloadselect.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