BVB Source Codes

mars Show binding.hpp Source code

Return Download mars: download binding.hpp Source code - Download mars Source code - Type:.hpp
  1. // Copyright David Abrahams 2005. Distributed under the Boost
  2. // Software License, Version 1.0. (See accompanying
  3. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  4. #ifndef BOOST_PARAMETER_BINDING_DWA200558_HPP
  5. # define BOOST_PARAMETER_BINDING_DWA200558_HPP
  6.  
  7. # include <boost/mpl/apply.hpp>
  8. # include <boost/mpl/assert.hpp>
  9. # include <boost/mpl/and.hpp>
  10. # include <boost/parameter/aux_/result_of0.hpp>
  11. # include <boost/parameter/aux_/void.hpp>
  12. # include <boost/type_traits/is_same.hpp>
  13.  
  14. namespace mars_boost {} namespace boost = mars_boost; namespace mars_boost { namespace parameter {
  15.  
  16. // A metafunction that, given an argument pack, returns the type of
  17. // the parameter identified by the given keyword.  If no such
  18. // parameter has been specified, returns Default
  19.  
  20. # if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
  21. template <class Parameters, class Keyword, class Default>
  22. struct binding0
  23. {
  24.     typedef typename mpl::apply_wrap3<
  25.         typename Parameters::binding,Keyword,Default,mpl::true_
  26.     >::type type;
  27.  
  28.     BOOST_MPL_ASSERT_NOT((
  29.         mpl::and_<
  30.             is_same<Default, void_>
  31.           , is_same<type, void_>
  32.         >
  33.     ));
  34. };
  35. # endif
  36.  
  37. template <class Parameters, class Keyword, class Default = void_>
  38. struct binding
  39. {
  40. # if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
  41.     typedef typename mpl::eval_if<
  42.         mpl::is_placeholder<Parameters>
  43.       , mpl::identity<int>
  44.       , binding0<Parameters,Keyword,Default>
  45.     >::type type;
  46. # else
  47.     typedef typename mpl::apply_wrap3<
  48.         typename Parameters::binding,Keyword,Default,mpl::true_
  49.     >::type type;
  50.  
  51.     BOOST_MPL_ASSERT_NOT((
  52.         mpl::and_<
  53.             is_same<Default, void_>
  54.           , is_same<type, void_>
  55.         >
  56.     ));
  57. # endif
  58.  
  59.     BOOST_MPL_AUX_LAMBDA_SUPPORT(3,binding,(Parameters,Keyword,Default))
  60. };
  61.  
  62. // A metafunction that, given an argument pack, returns the type of
  63. // the parameter identified by the given keyword.  If no such
  64. // parameter has been specified, returns the type returned by invoking
  65. // DefaultFn
  66. template <class Parameters, class Keyword, class DefaultFn>
  67. struct lazy_binding
  68. {
  69.   typedef typename mpl::apply_wrap3<
  70.       typename Parameters::binding
  71.     , Keyword
  72.     , typename aux::result_of0<DefaultFn>::type
  73.     , mpl::true_
  74.   >::type type;
  75. };
  76.  
  77.  
  78. }} // namespace mars_boost::parameter
  79.  
  80. #endif // BOOST_PARAMETER_BINDING_DWA200558_HPP
  81.  
downloadbinding.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