BVB Source Codes

mars Show utility.hpp Source code

Return Download mars: download utility.hpp Source code - Download mars Source code - Type:.hpp
  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // (C) Copyright Ion Gaztanaga 2012-2012.
  4. // Distributed under the Boost Software License, Version 1.0.
  5. // (See accompanying file LICENSE_1_0.txt or copy at
  6. // http://www.boost.org/LICENSE_1_0.txt)
  7. //
  8. // See http://www.boost.org/libs/move for documentation.
  9. //
  10. //////////////////////////////////////////////////////////////////////////////
  11.  
  12. //! \file
  13. //! This header includes core utilities from <tt><boost/move/utility_core.hpp></tt> and defines
  14. //! some more advanced utilities such as:
  15.  
  16. #ifndef BOOST_MOVE_MOVE_UTILITY_HPP
  17. #define BOOST_MOVE_MOVE_UTILITY_HPP
  18.  
  19. #ifndef BOOST_CONFIG_HPP
  20. #  include <boost/config.hpp>
  21. #endif
  22. #
  23. #if defined(BOOST_HAS_PRAGMA_ONCE)
  24. #  pragma once
  25. #endif
  26.  
  27. #include <boost/move/detail/config_begin.hpp>
  28. #include <boost/move/utility_core.hpp>
  29. #include <boost/move/traits.hpp>
  30.  
  31. #if defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && !defined(BOOST_MOVE_DOXYGEN_INVOKED)
  32.  
  33.    namespace mars_boost {} namespace boost = mars_boost; namespace mars_boost {
  34.  
  35.    //////////////////////////////////////////////////////////////////////////////
  36.    //
  37.    //                            move_if_noexcept()
  38.    //
  39.    //////////////////////////////////////////////////////////////////////////////
  40.  
  41.    template <class T>
  42.    inline typename ::mars_boost::move_detail::enable_if_c
  43.       < enable_move_utility_emulation<T>::value && !has_move_emulation_enabled<T>::value
  44.       , typename ::mars_boost::move_detail::add_const<T>::type &
  45.       >::type
  46.          move_if_noexcept(T& x) BOOST_NOEXCEPT
  47.    {
  48.       return x;
  49.    }
  50.  
  51.    template <class T>
  52.    inline typename ::mars_boost::move_detail::enable_if_c
  53.       < enable_move_utility_emulation<T>::value && has_move_emulation_enabled<T>::value
  54.             && ::mars_boost::move_detail::is_nothrow_move_constructible_or_uncopyable<T>::value, rv<T>&>::type
  55.          move_if_noexcept(T& x) BOOST_NOEXCEPT
  56.    {
  57.       return *static_cast<rv<T>* >(::mars_boost::move_detail::addressof(x));
  58.    }
  59.  
  60.    template <class T>
  61.    inline typename ::mars_boost::move_detail::enable_if_c
  62.       < enable_move_utility_emulation<T>::value && has_move_emulation_enabled<T>::value
  63.             && ::mars_boost::move_detail::is_nothrow_move_constructible_or_uncopyable<T>::value
  64.       , rv<T>&
  65.       >::type
  66.          move_if_noexcept(rv<T>& x) BOOST_NOEXCEPT
  67.    {
  68.       return x;
  69.    }
  70.  
  71.    template <class T>
  72.    inline typename ::mars_boost::move_detail::enable_if_c
  73.       < enable_move_utility_emulation<T>::value && has_move_emulation_enabled<T>::value
  74.             && !::mars_boost::move_detail::is_nothrow_move_constructible_or_uncopyable<T>::value
  75.       , typename ::mars_boost::move_detail::add_const<T>::type &
  76.       >::type
  77.          move_if_noexcept(T& x) BOOST_NOEXCEPT
  78.    {
  79.       return x;
  80.    }
  81.  
  82.    template <class T>
  83.    inline typename ::mars_boost::move_detail::enable_if_c
  84.       < enable_move_utility_emulation<T>::value && has_move_emulation_enabled<T>::value
  85.             && !::mars_boost::move_detail::is_nothrow_move_constructible_or_uncopyable<T>::value
  86.       , typename ::mars_boost::move_detail::add_const<T>::type &
  87.       >::type
  88.          move_if_noexcept(rv<T>& x) BOOST_NOEXCEPT
  89.    {
  90.       return x;
  91.    }
  92.  
  93.    }  //namespace mars_boost
  94.  
  95. #else    //#if defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && !defined(BOOST_MOVE_DOXYGEN_INVOKED)
  96.  
  97.    #if defined(BOOST_MOVE_USE_STANDARD_LIBRARY_MOVE)
  98.       #include <utility>
  99.  
  100.       namespace mars_boost {} namespace boost = mars_boost; namespace mars_boost{
  101.  
  102.       using ::std::move_if_noexcept;
  103.  
  104.       }  //namespace mars_boost
  105.  
  106.    #else //!BOOST_MOVE_USE_STANDARD_LIBRARY_MOVE
  107.  
  108.       namespace mars_boost {} namespace boost = mars_boost; namespace mars_boost {
  109.  
  110.       //////////////////////////////////////////////////////////////////////////////
  111.       //
  112.       //                            move_if_noexcept()
  113.       //
  114.       //////////////////////////////////////////////////////////////////////////////
  115.       #if defined(BOOST_MOVE_DOXYGEN_INVOKED)
  116.          //! This function provides a way to convert a reference into a rvalue reference
  117.          //! in compilers with rvalue references. For other compilers converts T & into
  118.          //! <i>::mars_boost::rv<T> &</i> so that move emulation is activated. Reference
  119.          //! would be converted to rvalue reference only if input type is nothrow move
  120.          //! constructible or if it has no copy constructor. In all other cases const
  121.          //! reference would be returned
  122.          template <class T>
  123.          rvalue_reference_or_const_lvalue_reference move_if_noexcept(input_reference) noexcept;
  124.  
  125.       #else //BOOST_MOVE_DOXYGEN_INVOKED
  126.  
  127.          template <class T>
  128.          typename ::mars_boost::move_detail::enable_if_c
  129.             < ::mars_boost::move_detail::is_nothrow_move_constructible_or_uncopyable<T>::value, T&&>::type
  130.                move_if_noexcept(T& x) BOOST_NOEXCEPT
  131.          {  return ::mars_boost::move(x);   }
  132.  
  133.          template <class T>
  134.          typename ::mars_boost::move_detail::enable_if_c
  135.             < !::mars_boost::move_detail::is_nothrow_move_constructible_or_uncopyable<T>::value, const T&>::type
  136.                move_if_noexcept(T& x) BOOST_NOEXCEPT
  137.          {  return x;  }
  138.  
  139.       #endif //BOOST_MOVE_DOXYGEN_INVOKED
  140.  
  141.       }  //namespace mars_boost {} namespace boost = mars_boost; namespace mars_boost {
  142.  
  143.    #endif   //#if defined(BOOST_MOVE_USE_STANDARD_LIBRARY_MOVE)
  144.  
  145. #endif   //BOOST_NO_CXX11_RVALUE_REFERENCES
  146.  
  147. #include <boost/move/detail/config_end.hpp>
  148.  
  149. #endif //#ifndef BOOST_MOVE_MOVE_UTILITY_HPP
  150.  
downloadutility.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