Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/boost/asio/detail/initiation_base.hpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 //
0002 // detail/initiation_base.hpp
0003 // ~~~~~~~~~~~~~~~~~~~~~~~~~~
0004 //
0005 // Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
0006 //
0007 // Distributed under the Boost Software License, Version 1.0. (See accompanying
0008 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0009 //
0010 
0011 #ifndef BOOST_ASIO_DETAIL_INITIATION_BASE_HPP
0012 #define BOOST_ASIO_DETAIL_INITIATION_BASE_HPP
0013 
0014 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
0015 # pragma once
0016 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
0017 
0018 #include <boost/asio/detail/config.hpp>
0019 #include <boost/asio/detail/type_traits.hpp>
0020 
0021 #include <boost/asio/detail/push_options.hpp>
0022 
0023 namespace boost {
0024 namespace asio {
0025 namespace detail {
0026 
0027 template <typename Initiation, typename = void>
0028 class initiation_base : public Initiation
0029 {
0030 public:
0031   template <typename I>
0032   explicit initiation_base(I&& initiation)
0033     : Initiation(static_cast<I&&>(initiation))
0034   {
0035   }
0036 };
0037 
0038 template <typename Initiation>
0039 class initiation_base<Initiation, enable_if_t<!is_class<Initiation>::value>>
0040 {
0041 public:
0042   template <typename I>
0043   explicit initiation_base(I&& initiation)
0044     : initiation_(static_cast<I&&>(initiation))
0045   {
0046   }
0047 
0048   template <typename... Args>
0049   void operator()(Args&&... args) const
0050   {
0051     initiation_(static_cast<Args&&>(args)...);
0052   }
0053 
0054 private:
0055   Initiation initiation_;
0056 };
0057 
0058 } // namespace detail
0059 } // namespace asio
0060 } // namespace boost
0061 
0062 #include <boost/asio/detail/pop_options.hpp>
0063 
0064 #endif // BOOST_ASIO_DETAIL_INITIATION_BASE_HPP