BVB Source Codes

mars Show at.hpp Source code

Return Download mars: download at.hpp Source code - Download mars Source code - Type:.hpp
  1.  
  2. #ifndef BOOST_MPL_VECTOR_AUX_AT_HPP_INCLUDED
  3. #define BOOST_MPL_VECTOR_AUX_AT_HPP_INCLUDED
  4.  
  5. // Copyright Aleksey Gurtovoy 2000-2004
  6. //
  7. // Distributed under the Boost Software License, Version 1.0.
  8. // (See accompanying file LICENSE_1_0.txt or copy at
  9. // http://www.boost.org/LICENSE_1_0.txt)
  10. //
  11. // See http://www.boost.org/libs/mpl for documentation.
  12.  
  13. // $Id$
  14. // $Date$
  15. // $Revision$
  16.  
  17. #include <boost/mpl/at_fwd.hpp>
  18. #include <boost/mpl/vector/aux_/tag.hpp>
  19. #include <boost/mpl/long.hpp>
  20. #include <boost/mpl/void.hpp>
  21. #include <boost/mpl/aux_/nttp_decl.hpp>
  22. #include <boost/mpl/aux_/type_wrapper.hpp>
  23. #include <boost/mpl/aux_/value_wknd.hpp>
  24. #include <boost/mpl/aux_/config/typeof.hpp>
  25. #include <boost/mpl/aux_/config/ctps.hpp>
  26.  
  27. namespace mars_boost {} namespace boost = mars_boost; namespace mars_boost { namespace mpl {
  28.  
  29. #if defined(BOOST_MPL_CFG_TYPEOF_BASED_SEQUENCES)
  30.  
  31. template< typename Vector, long n_ >
  32. struct v_at_impl
  33. {
  34.     typedef long_< (Vector::lower_bound_::value + n_) > index_;
  35.     typedef __typeof__( Vector::item_(index_()) ) type;
  36. };
  37.  
  38.  
  39. template< typename Vector, long n_ >
  40. struct v_at
  41.     : aux::wrapped_type< typename v_at_impl<Vector,n_>::type >
  42. {
  43. };
  44.  
  45. template<>
  46. struct at_impl< aux::vector_tag >
  47. {
  48.     template< typename Vector, typename N > struct apply
  49.         : v_at<
  50.               Vector
  51.             , BOOST_MPL_AUX_VALUE_WKND(N)::value
  52.             >
  53.     {
  54.     };
  55. };
  56.  
  57. #else
  58.  
  59. #   if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
  60.     && !defined(BOOST_MPL_CFG_NO_NONTYPE_TEMPLATE_PARTIAL_SPEC)
  61.  
  62. template< typename Vector, BOOST_MPL_AUX_NTTP_DECL(long, n_) > struct v_at;
  63.  
  64. template< BOOST_MPL_AUX_NTTP_DECL(long, n_) >
  65. struct at_impl< aux::vector_tag<n_> >
  66. {
  67.     template< typename Vector, typename N > struct apply
  68. #if !defined(__BORLANDC__)
  69.         : v_at<
  70.               Vector
  71.             , BOOST_MPL_AUX_VALUE_WKND(N)::value
  72.             >
  73.     {
  74. #else
  75.     {
  76.         typedef typename v_at<
  77.               Vector
  78.             , BOOST_MPL_AUX_VALUE_WKND(N)::value
  79.             >::type type;
  80. #endif
  81.     };
  82. };
  83.  
  84. #   else
  85.  
  86. namespace aux {
  87.  
  88. template< BOOST_MPL_AUX_NTTP_DECL(long, n_) > struct v_at_impl
  89. {
  90.     template< typename V > struct result_;
  91. };
  92.  
  93. // to work around ETI, etc.
  94. template<> struct v_at_impl<-1>
  95. {
  96.     template< typename V > struct result_
  97.     {
  98.         typedef void_ type;
  99.     };
  100. };
  101.  
  102. } // namespace aux
  103.  
  104. template< typename T, BOOST_MPL_AUX_NTTP_DECL(long, n_) >
  105. struct v_at
  106.     : aux::v_at_impl<n_>::template result_<T>
  107. {
  108. };
  109.  
  110. #   endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
  111.  
  112. #endif // BOOST_MPL_CFG_TYPEOF_BASED_SEQUENCES
  113.  
  114. }}
  115.  
  116. #endif // BOOST_MPL_VECTOR_AUX_AT_HPP_INCLUDED
  117.  
downloadat.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