BVB Source Codes

mars Show default.hpp Source code

Return Download mars: download default.hpp Source code - Download mars Source code - Type:.hpp
  1. // Copyright Daniel Wallin, David Abrahams 2005. Use, modification and
  2. // distribution is subject to the Boost Software License, Version 1.0. (See
  3. // accompanying file LICENSE_1_0.txt or copy at
  4. // http://www.boost.org/LICENSE_1_0.txt)
  5.  
  6. #ifndef DEFAULT_050329_HPP
  7. # define DEFAULT_050329_HPP
  8.  
  9. # include <boost/detail/workaround.hpp>
  10.  
  11. namespace mars_boost {} namespace boost = mars_boost; namespace mars_boost { namespace parameter { namespace aux {
  12.  
  13. // A wrapper for the default value passed by the user when resolving
  14. // the value of the parameter with the given Keyword
  15. template <class Keyword, class Value>
  16. struct default_
  17. {
  18.     default_(Value& x)
  19.       : value(x)
  20.     {}
  21.  
  22.     Value& value;
  23. };
  24.  
  25. //
  26. // lazy_default --
  27. //
  28. //    A wrapper for the default value computation function passed by
  29. //    the user when resolving the value of the parameter with the
  30. //    given keyword
  31. //
  32. # if BOOST_WORKAROUND(__EDG_VERSION__, <= 300)
  33. // These compilers need a little extra help with overload
  34. // resolution; we have empty_arg_list's operator[] accept a base
  35. // class to make that overload less preferable.
  36. template <class KW, class DefaultComputer>
  37. struct lazy_default_base
  38. {
  39.     lazy_default_base(DefaultComputer const& x)
  40.       : compute_default(x)
  41.     {}
  42.     DefaultComputer const& compute_default;
  43. };
  44.  
  45. template <class KW, class DefaultComputer>
  46. struct lazy_default
  47.   : lazy_default_base<KW,DefaultComputer>
  48.   {
  49.       lazy_default(DefaultComputer const & x)
  50.         : lazy_default_base<KW,DefaultComputer>(x)
  51.       {}
  52.   };
  53. #  define BOOST_PARAMETER_lazy_default_fallback lazy_default_base
  54. # else
  55. template <class KW, class DefaultComputer>
  56. struct lazy_default
  57. {
  58.     lazy_default(const DefaultComputer& x)
  59.       : compute_default(x)
  60.     {}
  61.     DefaultComputer const& compute_default;
  62. };
  63. #  define BOOST_PARAMETER_lazy_default_fallback lazy_default
  64. # endif
  65.  
  66. }}} // namespace mars_boost::parameter::aux
  67.  
  68. #endif // DEFAULT_050329_HPP
  69.  
  70.  
downloaddefault.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