BVB Source Codes

mars Show reference_content.hpp Source code

Return Download mars: download reference_content.hpp Source code - Download mars Source code - Type:.hpp
  1. //-----------------------------------------------------------------------------
  2. // boost detail/reference_content.hpp header file
  3. // See http://www.boost.org for updates, documentation, and revision history.
  4. //-----------------------------------------------------------------------------
  5. //
  6. // Copyright (c) 2003
  7. // Eric Friedman
  8. //
  9. // Distributed under the Boost Software License, Version 1.0. (See
  10. // accompanying file LICENSE_1_0.txt or copy at
  11. // http://www.boost.org/LICENSE_1_0.txt)
  12.  
  13. #ifndef BOOST_DETAIL_REFERENCE_CONTENT_HPP
  14. #define BOOST_DETAIL_REFERENCE_CONTENT_HPP
  15.  
  16. #include "boost/config.hpp"
  17.  
  18. #   include "boost/mpl/bool.hpp"
  19. #   include "boost/type_traits/has_nothrow_copy.hpp"
  20.  
  21. #include "boost/mpl/void.hpp"
  22.  
  23. namespace mars_boost {} namespace boost = mars_boost; namespace mars_boost {
  24.  
  25. namespace detail {
  26.  
  27. ///////////////////////////////////////////////////////////////////////////////
  28. // (detail) class template reference_content
  29. //
  30. // Non-Assignable wrapper for references.
  31. //
  32. template <typename RefT>
  33. class reference_content
  34. {
  35. private: // representation
  36.  
  37.     RefT content_;
  38.  
  39. public: // structors
  40.  
  41.     ~reference_content()
  42.     {
  43.     }
  44.  
  45.     reference_content(RefT r)
  46.         : content_( r )
  47.     {
  48.     }
  49.  
  50.     reference_content(const reference_content& operand)
  51.         : content_( operand.content_ )
  52.     {
  53.     }
  54.  
  55. private: // non-Assignable
  56.  
  57.     reference_content& operator=(const reference_content&);
  58.  
  59. public: // queries
  60.  
  61.     RefT get() const
  62.     {
  63.         return content_;
  64.     }
  65.  
  66. };
  67.  
  68. ///////////////////////////////////////////////////////////////////////////////
  69. // (detail) metafunction make_reference_content
  70. //
  71. // Wraps with reference_content if specified type is reference.
  72. //
  73.  
  74. template <typename T = mpl::void_> struct make_reference_content;
  75.  
  76.  
  77. template <typename T>
  78. struct make_reference_content
  79. {
  80.     typedef T type;
  81. };
  82.  
  83. template <typename T>
  84. struct make_reference_content< T& >
  85. {
  86.     typedef reference_content<T&> type;
  87. };
  88.  
  89.  
  90. template <>
  91. struct make_reference_content< mpl::void_ >
  92. {
  93.     template <typename T>
  94.     struct apply
  95.         : make_reference_content<T>
  96.     {
  97.     };
  98.  
  99.     typedef mpl::void_ type;
  100. };
  101.  
  102. } // namespace detail
  103.  
  104. ///////////////////////////////////////////////////////////////////////////////
  105. // reference_content<T&> type traits specializations
  106. //
  107.  
  108.  
  109. template <typename T>
  110. struct has_nothrow_copy<
  111.       ::mars_boost::detail::reference_content< T& >
  112.     >
  113.     : mpl::true_
  114. {
  115. };
  116.  
  117.  
  118. } // namespace mars_boost
  119.  
  120. #endif // BOOST_DETAIL_REFERENCE_CONTENT_HPP
  121.  
downloadreference_content.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