1 /*
2  *          Copyright Andrey Semashev 2007 - 2015.
3  * Distributed under the Boost Software License, Version 1.0.
4  *    (See accompanying file LICENSE_1_0.txt or copy at
5  *          http://www.boost.org/LICENSE_1_0.txt)
6  */
7 /*!
8  * \file   copy_cv.hpp
9  * \author Andrey Semashev
10  * \date   16.03.2014
11  *
12  * The header defines \c copy_cv type trait which copies const/volatile qualifiers from one type to another
13  */
14 
15 #ifndef BOOST_LOG_DETAIL_COPY_CV_HPP_INCLUDED_
16 #define BOOST_LOG_DETAIL_COPY_CV_HPP_INCLUDED_
17 
18 #include <boost/log/detail/config.hpp>
19 #include <boost/log/detail/header.hpp>
20 
21 #ifdef BOOST_HAS_PRAGMA_ONCE
22 #pragma once
23 #endif
24 
25 namespace boost {
26 
27 BOOST_LOG_OPEN_NAMESPACE
28 
29 namespace aux {
30 
31 //! The type trait copies top level const/volatile qualifiers from \c FromT to \c ToT
32 template< typename FromT, typename ToT >
33 struct copy_cv
34 {
35     typedef ToT type;
36 };
37 
38 template< typename FromT, typename ToT >
39 struct copy_cv< const FromT, ToT >
40 {
41     typedef const ToT type;
42 };
43 
44 template< typename FromT, typename ToT >
45 struct copy_cv< volatile FromT, ToT >
46 {
47     typedef volatile ToT type;
48 };
49 
50 template< typename FromT, typename ToT >
51 struct copy_cv< const volatile FromT, ToT >
52 {
53     typedef const volatile ToT type;
54 };
55 
56 } // namespace aux
57 
58 BOOST_LOG_CLOSE_NAMESPACE // namespace log
59 
60 } // namespace boost
61 
62 #include <boost/log/detail/footer.hpp>
63 
64 #endif // BOOST_LOG_DETAIL_COPY_CV_HPP_INCLUDED_
65